diff --git a/client/client.ts b/client/client.ts index 03d3f9f3..a6a13b7c 100644 --- a/client/client.ts +++ b/client/client.ts @@ -863,9 +863,12 @@ export class Client { if (currentNode) { let node: SyntaxNode | null = currentNode; do { - if (node.name === "FencedCode" || node.name === "FrontMatter") { + if (["FencedCode", "FrontMatter"].includes(node.name)) { const body = editorState.sliceDoc(node.from + 3, node.to - 3); parentNodes.push(`${node.name}:${body}`); + } else if (node.name === "LuaDirective") { + const body = editorState.sliceDoc(node.from + 2, node.to - 1); + parentNodes.push(`${node.name}:${body}`); } else { parentNodes.push(node.name); } diff --git a/client/codemirror/smart_quotes.ts b/client/codemirror/smart_quotes.ts index 2f1b76b7..06199950 100644 --- a/client/codemirror/smart_quotes.ts +++ b/client/codemirror/smart_quotes.ts @@ -36,7 +36,9 @@ function keyBindingForQuote( // Figure out the context, if in some sort of code/comment fragment don't be smart let node = syntaxTree(target.state).resolveInner(cursorPos); while (node) { - if (straightQuoteContexts.includes(node.type.name)) { + if ( + straightQuoteContexts.find((sqc) => sqc.startsWith(node.type.name)) + ) { return false; } if (node.parent) {