@kerebron/extension-codejar 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/{extension-codejar/src/CodeJar.d.ts → CodeJar.d.ts} +1 -1
- package/esm/CodeJar.d.ts.map +1 -0
- package/esm/{extension-codejar/src/CodeJar.js → CodeJar.js} +1 -1
- package/esm/Decorator.d.ts.map +1 -0
- package/esm/{extension-codejar/src/ExtensionCodeJar.d.ts → ExtensionCodeJar.d.ts} +1 -1
- package/esm/ExtensionCodeJar.d.ts.map +1 -0
- package/esm/{extension-codejar/src/ExtensionCodeJar.js → ExtensionCodeJar.js} +2 -2
- package/esm/{extension-codejar/src/NodeCodeJar.d.ts → NodeCodeJar.d.ts} +3 -3
- package/esm/NodeCodeJar.d.ts.map +1 -0
- package/esm/{extension-codejar/src/NodeCodeJar.js → NodeCodeJar.js} +3 -3
- package/esm/{extension-codejar/src/TreeSitterHighlighter.d.ts → TreeSitterHighlighter.d.ts} +1 -1
- package/esm/TreeSitterHighlighter.d.ts.map +1 -0
- package/esm/{extension-codejar/src/TreeSitterHighlighter.js → TreeSitterHighlighter.js} +3 -8
- package/esm/{extension-codejar/src/codeJarBlockNodeView.d.ts → codeJarBlockNodeView.d.ts} +1 -1
- package/esm/codeJarBlockNodeView.d.ts.map +1 -0
- package/esm/{extension-codejar/src/codeJarBlockNodeView.js → codeJarBlockNodeView.js} +2 -2
- package/esm/codeJarLineNumbers.d.ts.map +1 -0
- package/esm/mod.d.ts +2 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/{extension-codejar/src/mod.js → mod.js} +0 -1
- package/esm/utils.d.ts.map +1 -0
- package/package.json +10 -6
- package/esm/_dnt.polyfills.d.ts +0 -101
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -127
- package/esm/editor/src/CoreEditor.d.ts +0 -40
- package/esm/editor/src/CoreEditor.d.ts.map +0 -1
- package/esm/editor/src/CoreEditor.js +0 -252
- package/esm/editor/src/DummyEditorView.d.ts +0 -60
- package/esm/editor/src/DummyEditorView.d.ts.map +0 -1
- package/esm/editor/src/DummyEditorView.js +0 -277
- package/esm/editor/src/Extension.d.ts +0 -31
- package/esm/editor/src/Extension.d.ts.map +0 -1
- package/esm/editor/src/Extension.js +0 -53
- package/esm/editor/src/ExtensionManager.d.ts +0 -32
- package/esm/editor/src/ExtensionManager.d.ts.map +0 -1
- package/esm/editor/src/ExtensionManager.js +0 -260
- package/esm/editor/src/Mark.d.ts +0 -23
- package/esm/editor/src/Mark.d.ts.map +0 -1
- package/esm/editor/src/Mark.js +0 -51
- package/esm/editor/src/Node.d.ts +0 -32
- package/esm/editor/src/Node.d.ts.map +0 -1
- package/esm/editor/src/Node.js +0 -60
- package/esm/editor/src/commands/CommandManager.d.ts +0 -23
- package/esm/editor/src/commands/CommandManager.d.ts.map +0 -1
- package/esm/editor/src/commands/CommandManager.js +0 -118
- package/esm/editor/src/commands/baseCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/baseCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/baseCommandFactories.js +0 -836
- package/esm/editor/src/commands/createChainableState.d.ts +0 -3
- package/esm/editor/src/commands/createChainableState.d.ts.map +0 -1
- package/esm/editor/src/commands/createChainableState.js +0 -29
- package/esm/editor/src/commands/keyCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/keyCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/keyCommandFactories.js +0 -10
- package/esm/editor/src/commands/mod.d.ts +0 -7
- package/esm/editor/src/commands/mod.d.ts.map +0 -1
- package/esm/editor/src/commands/mod.js +0 -76
- package/esm/editor/src/commands/replaceCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/replaceCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/replaceCommandFactories.js +0 -94
- package/esm/editor/src/commands/types.d.ts +0 -18
- package/esm/editor/src/commands/types.d.ts.map +0 -1
- package/esm/editor/src/commands/types.js +0 -1
- package/esm/editor/src/mod.d.ts +0 -9
- package/esm/editor/src/mod.d.ts.map +0 -1
- package/esm/editor/src/mod.js +0 -8
- package/esm/editor/src/nodeToTreeString.d.ts +0 -10
- package/esm/editor/src/nodeToTreeString.d.ts.map +0 -1
- package/esm/editor/src/nodeToTreeString.js +0 -74
- package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts +0 -6
- package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts.map +0 -1
- package/esm/editor/src/plugins/TrackSelecionPlugin.js +0 -24
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts +0 -23
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +0 -163
- package/esm/editor/src/plugins/input-rules/mod.d.ts +0 -3
- package/esm/editor/src/plugins/input-rules/mod.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/mod.js +0 -2
- package/esm/editor/src/plugins/input-rules/rulebuilders.d.ts +0 -5
- package/esm/editor/src/plugins/input-rules/rulebuilders.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/rulebuilders.js +0 -50
- package/esm/editor/src/plugins/keymap/keymap.d.ts +0 -11
- package/esm/editor/src/plugins/keymap/keymap.d.ts.map +0 -1
- package/esm/editor/src/plugins/keymap/keymap.js +0 -125
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +0 -4
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +0 -1
- package/esm/editor/src/plugins/keymap/w3c-keyname.js +0 -124
- package/esm/editor/src/types.d.ts +0 -52
- package/esm/editor/src/types.d.ts.map +0 -1
- package/esm/editor/src/types.js +0 -1
- package/esm/editor/src/ui.d.ts +0 -15
- package/esm/editor/src/ui.d.ts.map +0 -1
- package/esm/editor/src/ui.js +0 -16
- package/esm/editor/src/utilities/SmartOutput.d.ts +0 -41
- package/esm/editor/src/utilities/SmartOutput.d.ts.map +0 -1
- package/esm/editor/src/utilities/SmartOutput.js +0 -228
- package/esm/editor/src/utilities/createNodeFromContent.d.ts +0 -9
- package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +0 -1
- package/esm/editor/src/utilities/createNodeFromContent.js +0 -32
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts +0 -9
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +0 -1
- package/esm/editor/src/utilities/getHtmlAttributes.js +0 -47
- package/esm/editor/src/utilities/getShadowRoot.d.ts +0 -2
- package/esm/editor/src/utilities/getShadowRoot.d.ts.map +0 -1
- package/esm/editor/src/utilities/getShadowRoot.js +0 -16
- package/esm/editor/src/utilities/mod.d.ts +0 -6
- package/esm/editor/src/utilities/mod.d.ts.map +0 -1
- package/esm/editor/src/utilities/mod.js +0 -5
- package/esm/editor/src/utilities/toRawTextResult.d.ts +0 -3
- package/esm/editor/src/utilities/toRawTextResult.d.ts.map +0 -1
- package/esm/editor/src/utilities/toRawTextResult.js +0 -21
- package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts +0 -8
- package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/AutocompletePlugin.js +0 -232
- package/esm/extension-autocomplete/src/DefaultRenderer.d.ts +0 -17
- package/esm/extension-autocomplete/src/DefaultRenderer.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/DefaultRenderer.js +0 -137
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts +0 -26
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.js +0 -30
- package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts +0 -11
- package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/createDefaultMatcher.js +0 -58
- package/esm/extension-autocomplete/src/createRegexMatcher.d.ts +0 -4
- package/esm/extension-autocomplete/src/createRegexMatcher.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/createRegexMatcher.js +0 -50
- package/esm/extension-autocomplete/src/mod.d.ts +0 -3
- package/esm/extension-autocomplete/src/mod.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/mod.js +0 -2
- package/esm/extension-autocomplete/src/types.d.ts +0 -60
- package/esm/extension-autocomplete/src/types.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/types.js +0 -1
- package/esm/extension-basic-editor/src/ExtensionHtml.d.ts +0 -15
- package/esm/extension-basic-editor/src/ExtensionHtml.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/ExtensionHtml.js +0 -108
- package/esm/extension-basic-editor/src/NodeCodeBlock.d.ts +0 -9
- package/esm/extension-basic-editor/src/NodeCodeBlock.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/NodeCodeBlock.js +0 -58
- package/esm/extension-codejar/src/CodeJar.d.ts.map +0 -1
- package/esm/extension-codejar/src/Decorator.d.ts.map +0 -1
- package/esm/extension-codejar/src/ExtensionCodeJar.d.ts.map +0 -1
- package/esm/extension-codejar/src/NodeCodeJar.d.ts.map +0 -1
- package/esm/extension-codejar/src/TreeSitterHighlighter.d.ts.map +0 -1
- package/esm/extension-codejar/src/codeJarBlockNodeView.d.ts.map +0 -1
- package/esm/extension-codejar/src/codeJarLineNumbers.d.ts.map +0 -1
- package/esm/extension-codejar/src/mod.d.ts +0 -3
- package/esm/extension-codejar/src/mod.d.ts.map +0 -1
- package/esm/extension-codejar/src/utils.d.ts.map +0 -1
- package/esm/extension-lsp/src/DiagnosticPlugin.d.ts +0 -32
- package/esm/extension-lsp/src/DiagnosticPlugin.d.ts.map +0 -1
- package/esm/extension-lsp/src/DiagnosticPlugin.js +0 -131
- package/esm/extension-lsp/src/ExtensionLsp.d.ts +0 -25
- package/esm/extension-lsp/src/ExtensionLsp.d.ts.map +0 -1
- package/esm/extension-lsp/src/ExtensionLsp.js +0 -126
- package/esm/extension-lsp/src/LSPClient.d.ts +0 -56
- package/esm/extension-lsp/src/LSPClient.d.ts.map +0 -1
- package/esm/extension-lsp/src/LSPClient.js +0 -449
- package/esm/extension-lsp/src/computeIncrementalChanges.d.ts +0 -8
- package/esm/extension-lsp/src/computeIncrementalChanges.d.ts.map +0 -1
- package/esm/extension-lsp/src/computeIncrementalChanges.js +0 -82
- package/esm/extension-lsp/src/createLspAutocomplete.d.ts +0 -23
- package/esm/extension-lsp/src/createLspAutocomplete.d.ts.map +0 -1
- package/esm/extension-lsp/src/createLspAutocomplete.js +0 -68
- package/esm/extension-lsp/src/mod.d.ts +0 -4
- package/esm/extension-lsp/src/mod.d.ts.map +0 -1
- package/esm/extension-lsp/src/mod.js +0 -3
- package/esm/extension-lsp/src/workspace.d.ts +0 -62
- package/esm/extension-lsp/src/workspace.d.ts.map +0 -1
- package/esm/extension-lsp/src/workspace.js +0 -168
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts +0 -36
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.js +0 -240
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts +0 -26
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.js +0 -115
- package/esm/extension-markdown/src/ExtensionMarkdown.d.ts +0 -22
- package/esm/extension-markdown/src/ExtensionMarkdown.d.ts.map +0 -1
- package/esm/extension-markdown/src/ExtensionMarkdown.js +0 -48
- package/esm/extension-markdown/src/MarkdownParser.d.ts +0 -61
- package/esm/extension-markdown/src/MarkdownParser.d.ts.map +0 -1
- package/esm/extension-markdown/src/MarkdownParser.js +0 -249
- package/esm/extension-markdown/src/MarkdownSerializer.d.ts +0 -42
- package/esm/extension-markdown/src/MarkdownSerializer.d.ts.map +0 -1
- package/esm/extension-markdown/src/MarkdownSerializer.js +0 -325
- package/esm/extension-markdown/src/PositionMapper.d.ts +0 -15
- package/esm/extension-markdown/src/PositionMapper.d.ts.map +0 -1
- package/esm/extension-markdown/src/PositionMapper.js +0 -100
- package/esm/extension-markdown/src/TokenSource.d.ts +0 -11
- package/esm/extension-markdown/src/TokenSource.d.ts.map +0 -1
- package/esm/extension-markdown/src/TokenSource.js +0 -39
- package/esm/extension-markdown/src/mdToPmConverter.d.ts +0 -5
- package/esm/extension-markdown/src/mdToPmConverter.d.ts.map +0 -1
- package/esm/extension-markdown/src/mdToPmConverter.js +0 -111
- package/esm/extension-markdown/src/pmToMdConverter.d.ts +0 -16
- package/esm/extension-markdown/src/pmToMdConverter.d.ts.map +0 -1
- package/esm/extension-markdown/src/pmToMdConverter.js +0 -433
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts +0 -4
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.js +0 -151
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts +0 -3
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.js +0 -34
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts +0 -6
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.js +0 -380
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts +0 -3
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.js +0 -323
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts +0 -9
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.js +0 -308
- package/esm/extension-markdown/src/treeSitterTokenizer.d.ts +0 -5
- package/esm/extension-markdown/src/treeSitterTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/treeSitterTokenizer.js +0 -769
- package/esm/extension-markdown/src/types.d.ts +0 -28
- package/esm/extension-markdown/src/types.d.ts.map +0 -1
- package/esm/extension-markdown/src/types.js +0 -131
- package/esm/extension-markdown/src/utils.d.ts +0 -8
- package/esm/extension-markdown/src/utils.d.ts.map +0 -1
- package/esm/extension-markdown/src/utils.js +0 -86
- package/esm/tree-sitter-shim/src/main.d.ts +0 -15
- package/esm/tree-sitter-shim/src/main.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/main.js +0 -25
- package/esm/tree-sitter-shim/src/tree_sitter/language.d.ts +0 -7
- package/esm/tree-sitter-shim/src/tree_sitter/language.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/language.js +0 -5
- package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts +0 -6
- package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/node.js +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts +0 -7
- package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/parser.js +0 -5
- package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts +0 -6
- package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/tree.js +0 -1
- package/esm/wasm/src/mod.d.ts +0 -12
- package/esm/wasm/src/mod.d.ts.map +0 -1
- package/esm/wasm/src/mod.js +0 -48
- package/esm/wasm/wasm.d.ts +0 -138
- package/esm/wasm/wasm.d.ts.map +0 -1
- package/esm/wasm/wasm.js +0 -120
- /package/esm/{extension-codejar/src/Decorator.d.ts → Decorator.d.ts} +0 -0
- /package/esm/{extension-codejar/src/Decorator.js → Decorator.js} +0 -0
- /package/esm/{extension-codejar/src/codeJarLineNumbers.d.ts → codeJarLineNumbers.d.ts} +0 -0
- /package/esm/{extension-codejar/src/codeJarLineNumbers.js → codeJarLineNumbers.js} +0 -0
- /package/esm/{extension-codejar/src/utils.d.ts → utils.d.ts} +0 -0
- /package/esm/{extension-codejar/src/utils.js → utils.js} +0 -0
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
import { Fragment } from 'prosemirror-model';
|
|
2
|
-
import { Token } from './types.js';
|
|
3
|
-
import { nodeToTreeStringOutput, } from '../../editor/src/mod.js';
|
|
4
|
-
import { MarkdownSerializer } from './MarkdownSerializer.js';
|
|
5
|
-
import { DocumentMarkdownTokenizer } from './DocumentMarkdownTokenizer.js';
|
|
6
|
-
import { SmartOutput } from '../../editor/src/utilities/mod.js';
|
|
7
|
-
function removeMarkedContent(node, markType) {
|
|
8
|
-
if (node.isText) {
|
|
9
|
-
const hasMark = node.marks.some((mark) => mark.type === markType);
|
|
10
|
-
return hasMark ? null : node;
|
|
11
|
-
}
|
|
12
|
-
if (node.isLeaf) {
|
|
13
|
-
return node;
|
|
14
|
-
}
|
|
15
|
-
const newContent = [];
|
|
16
|
-
node.content.forEach((child) => {
|
|
17
|
-
const cleaned = removeMarkedContent(child, markType);
|
|
18
|
-
if (cleaned) {
|
|
19
|
-
newContent.push(cleaned);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
return node.copy(Fragment.fromArray(newContent));
|
|
23
|
-
}
|
|
24
|
-
class MdStashContext {
|
|
25
|
-
constructor() {
|
|
26
|
-
Object.defineProperty(this, "ctxStash", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
configurable: true,
|
|
29
|
-
writable: true,
|
|
30
|
-
value: []
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(this, "currentCtx", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
writable: true,
|
|
36
|
-
value: void 0
|
|
37
|
-
});
|
|
38
|
-
this.currentCtx = {
|
|
39
|
-
meta: {},
|
|
40
|
-
};
|
|
41
|
-
this.stash();
|
|
42
|
-
}
|
|
43
|
-
stash() {
|
|
44
|
-
this.ctxStash.push(this.currentCtx);
|
|
45
|
-
this.currentCtx = {
|
|
46
|
-
...structuredClone({ ...this.currentCtx }),
|
|
47
|
-
};
|
|
48
|
-
return this.ctxStash.length - 1;
|
|
49
|
-
}
|
|
50
|
-
unstash() {
|
|
51
|
-
const ctx = this.ctxStash.pop();
|
|
52
|
-
if (!ctx) {
|
|
53
|
-
throw new Error('Unstash failed');
|
|
54
|
-
}
|
|
55
|
-
this.currentCtx = ctx;
|
|
56
|
-
}
|
|
57
|
-
get current() {
|
|
58
|
-
return this.currentCtx;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
export async function pmToMdConverter(document, config, schema, editor) {
|
|
62
|
-
const result = syncPmToMdConverter(document, config, schema, editor);
|
|
63
|
-
return new TextEncoder().encode(result.content);
|
|
64
|
-
}
|
|
65
|
-
export function syncPmToMdConverter(document, config, schema, editor) {
|
|
66
|
-
const ctx = new MdStashContext();
|
|
67
|
-
// TODO: refactor to Tokenizer
|
|
68
|
-
const defaultMarkdownTokenizer = new DocumentMarkdownTokenizer({
|
|
69
|
-
paragraph(node) {
|
|
70
|
-
return {
|
|
71
|
-
open: 'paragraph_open',
|
|
72
|
-
close: 'paragraph_close',
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
hr(node) {
|
|
76
|
-
return {
|
|
77
|
-
selfClose: 'hr',
|
|
78
|
-
};
|
|
79
|
-
},
|
|
80
|
-
heading(node) {
|
|
81
|
-
return {
|
|
82
|
-
open: (node) => {
|
|
83
|
-
if (!node.attrs.level) {
|
|
84
|
-
throw new Error('No heading level');
|
|
85
|
-
}
|
|
86
|
-
const token = new Token('heading_open', 'h' + node.attrs.level, 1);
|
|
87
|
-
return token;
|
|
88
|
-
},
|
|
89
|
-
///////
|
|
90
|
-
close: 'heading_close',
|
|
91
|
-
};
|
|
92
|
-
// state.write(state.repeat('#', node.attrs.level) + ' ');
|
|
93
|
-
// state.renderInline(node, false);
|
|
94
|
-
// state.closeBlock(node);
|
|
95
|
-
},
|
|
96
|
-
blockquote(node) {
|
|
97
|
-
return {
|
|
98
|
-
open: 'blockquote_open',
|
|
99
|
-
close: 'blockquote_close',
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
math() {
|
|
103
|
-
return {
|
|
104
|
-
open: 'math_block_open',
|
|
105
|
-
close: 'math_block_close',
|
|
106
|
-
// math_inline
|
|
107
|
-
// selfClose: (node) => {
|
|
108
|
-
// const token = new Token('math', 'math', 0);
|
|
109
|
-
// token.attrSet('content', node.attrs.content);
|
|
110
|
-
// if (node.attrs.type) {
|
|
111
|
-
// }
|
|
112
|
-
// return token;
|
|
113
|
-
// },
|
|
114
|
-
};
|
|
115
|
-
},
|
|
116
|
-
task_list(node) {
|
|
117
|
-
return {
|
|
118
|
-
open: (node) => {
|
|
119
|
-
ctx.stash();
|
|
120
|
-
ctx.current.meta['list_type'] = 'tl';
|
|
121
|
-
ctx.current.meta['list_type_symbol'] = '';
|
|
122
|
-
const token = new Token('task_list_open', 'ul', 1);
|
|
123
|
-
token.attrSet('symbol', '*');
|
|
124
|
-
return token;
|
|
125
|
-
},
|
|
126
|
-
close: (node) => {
|
|
127
|
-
ctx.unstash();
|
|
128
|
-
return new Token('task_list_close', 'ul', -1);
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
},
|
|
132
|
-
bullet_list(node) {
|
|
133
|
-
return {
|
|
134
|
-
open: (node) => {
|
|
135
|
-
ctx.stash();
|
|
136
|
-
ctx.current.meta['list_type'] = 'ul';
|
|
137
|
-
ctx.current.meta['list_type_symbol'] = '*';
|
|
138
|
-
const token = new Token('bullet_list_open', 'ul', 1);
|
|
139
|
-
token.attrSet('symbol', '*');
|
|
140
|
-
return token;
|
|
141
|
-
},
|
|
142
|
-
close: (node) => {
|
|
143
|
-
ctx.unstash();
|
|
144
|
-
return new Token('bullet_list_close', 'ul', -1);
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
},
|
|
148
|
-
ordered_list(node) {
|
|
149
|
-
return {
|
|
150
|
-
open: (node) => {
|
|
151
|
-
ctx.stash();
|
|
152
|
-
ctx.current.meta['list_type'] = 'ol';
|
|
153
|
-
ctx.current.meta['list_type_symbol'] = node.attrs['type'] ||
|
|
154
|
-
'1';
|
|
155
|
-
const token = new Token('ordered_list_open', 'ol', 1);
|
|
156
|
-
token.attrSet('symbol', node.attrs['type'] || '1');
|
|
157
|
-
return token;
|
|
158
|
-
},
|
|
159
|
-
close: (node) => {
|
|
160
|
-
ctx.unstash();
|
|
161
|
-
return new Token('ordered_list_close', 'ol', -1);
|
|
162
|
-
},
|
|
163
|
-
};
|
|
164
|
-
},
|
|
165
|
-
list_item(node) {
|
|
166
|
-
return {
|
|
167
|
-
open: (node) => {
|
|
168
|
-
const token = new Token('list_item_open', 'li', 1);
|
|
169
|
-
if (ctx.current.meta['list_type'] === 'ul') {
|
|
170
|
-
token.markup = ctx.current.meta['list_type_symbol'] || '-';
|
|
171
|
-
}
|
|
172
|
-
return token;
|
|
173
|
-
},
|
|
174
|
-
close: 'list_item_close',
|
|
175
|
-
};
|
|
176
|
-
},
|
|
177
|
-
task_item(node) {
|
|
178
|
-
return {
|
|
179
|
-
open: (node) => {
|
|
180
|
-
const token = new Token('task_item_open', 'li', 1);
|
|
181
|
-
token.attrSet('checked', node.attrs.checked ? 'checked' : '');
|
|
182
|
-
return token;
|
|
183
|
-
},
|
|
184
|
-
close: 'task_item_close',
|
|
185
|
-
};
|
|
186
|
-
},
|
|
187
|
-
table(node) {
|
|
188
|
-
return {
|
|
189
|
-
open: 'table_open',
|
|
190
|
-
close: 'table_close',
|
|
191
|
-
};
|
|
192
|
-
},
|
|
193
|
-
table_row(node) {
|
|
194
|
-
return {
|
|
195
|
-
open: 'tr_open',
|
|
196
|
-
close: 'tr_close',
|
|
197
|
-
};
|
|
198
|
-
},
|
|
199
|
-
table_cell(node) {
|
|
200
|
-
return {
|
|
201
|
-
open: 'td_open',
|
|
202
|
-
close: 'td_close',
|
|
203
|
-
};
|
|
204
|
-
},
|
|
205
|
-
table_header(node) {
|
|
206
|
-
return {
|
|
207
|
-
open: 'th_open',
|
|
208
|
-
close: 'th_close',
|
|
209
|
-
};
|
|
210
|
-
},
|
|
211
|
-
br(node) {
|
|
212
|
-
return {
|
|
213
|
-
selfClose: 'hardbreak',
|
|
214
|
-
};
|
|
215
|
-
},
|
|
216
|
-
text(node) {
|
|
217
|
-
return {
|
|
218
|
-
selfClose: (node) => {
|
|
219
|
-
const token = new Token('text', '', 0);
|
|
220
|
-
token.content = node.text || '';
|
|
221
|
-
return token;
|
|
222
|
-
},
|
|
223
|
-
};
|
|
224
|
-
},
|
|
225
|
-
code_block(node) {
|
|
226
|
-
return {
|
|
227
|
-
selfClose: (node) => {
|
|
228
|
-
const token = new Token('code_block', 'code', 0);
|
|
229
|
-
token.attrSet('lang', node.attrs.lang);
|
|
230
|
-
token.content = '';
|
|
231
|
-
node.forEach((child, offset) => {
|
|
232
|
-
token.content += child.text || '';
|
|
233
|
-
});
|
|
234
|
-
return token;
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
},
|
|
238
|
-
// html(state, node) {
|
|
239
|
-
// const domSerializer = DOMSerializer.fromSchema(schema);
|
|
240
|
-
// const element = domSerializer.serializeNode(node, {
|
|
241
|
-
// document: globalThis.document,
|
|
242
|
-
// });
|
|
243
|
-
// convertDomToLowerCase(element);
|
|
244
|
-
// const xmlSerializer = new XMLSerializer();
|
|
245
|
-
// const html = xmlSerializer.serializeToString(element) + '\n';
|
|
246
|
-
// // state.write(html.replace(/\sxmlns="[^"]*"/, ''));
|
|
247
|
-
// state.write(html);
|
|
248
|
-
// },
|
|
249
|
-
//
|
|
250
|
-
image(node) {
|
|
251
|
-
return {
|
|
252
|
-
selfClose: (node) => {
|
|
253
|
-
const token = new Token('image', 'img', 0);
|
|
254
|
-
token.attrSet('src', node.attrs.src);
|
|
255
|
-
if (node.attrs.title) {
|
|
256
|
-
token.attrSet('title', node.attrs.title);
|
|
257
|
-
}
|
|
258
|
-
return token;
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
},
|
|
262
|
-
}, {
|
|
263
|
-
em: {
|
|
264
|
-
open: 'em_open',
|
|
265
|
-
close: 'em_close',
|
|
266
|
-
mixable: true,
|
|
267
|
-
expelEnclosingWhitespace: true,
|
|
268
|
-
},
|
|
269
|
-
underline: {
|
|
270
|
-
open: 'underline_open',
|
|
271
|
-
close: 'underline_close',
|
|
272
|
-
mixable: true,
|
|
273
|
-
expelEnclosingWhitespace: true,
|
|
274
|
-
},
|
|
275
|
-
strong: {
|
|
276
|
-
open: 'strong_open',
|
|
277
|
-
close: 'strong_close',
|
|
278
|
-
mixable: true,
|
|
279
|
-
expelEnclosingWhitespace: true,
|
|
280
|
-
},
|
|
281
|
-
strike: {
|
|
282
|
-
open: 'strike_open',
|
|
283
|
-
close: 'strike_close',
|
|
284
|
-
mixable: true,
|
|
285
|
-
expelEnclosingWhitespace: true,
|
|
286
|
-
},
|
|
287
|
-
math: {
|
|
288
|
-
open: 'math_inline_open',
|
|
289
|
-
close: 'math_inline_close',
|
|
290
|
-
// math_inline
|
|
291
|
-
// selfClose: (node) => {
|
|
292
|
-
// const token = new Token('math', 'math', 0);
|
|
293
|
-
// token.attrSet('content', node.attrs.content);
|
|
294
|
-
// if (node.attrs.type) {
|
|
295
|
-
// }
|
|
296
|
-
// return token;
|
|
297
|
-
// },
|
|
298
|
-
},
|
|
299
|
-
link: {
|
|
300
|
-
open: (mark) => {
|
|
301
|
-
const token = new Token('link_open', 'a', 1);
|
|
302
|
-
token.attrSet('href', mark.attrs.href);
|
|
303
|
-
return token;
|
|
304
|
-
},
|
|
305
|
-
close: 'link_close',
|
|
306
|
-
mixable: true,
|
|
307
|
-
},
|
|
308
|
-
code: {
|
|
309
|
-
// selfClose: (node) => {
|
|
310
|
-
// const token = new Token('code_inline', 'code', 0);
|
|
311
|
-
// token.content = 'TODO_INLINE_CODE';
|
|
312
|
-
// // token.attrSet('content', node.attrs.content);
|
|
313
|
-
// // if (node.attrs.type) {
|
|
314
|
-
// // }
|
|
315
|
-
// return token;
|
|
316
|
-
// },
|
|
317
|
-
// open: (mark: Mark) => {
|
|
318
|
-
// },
|
|
319
|
-
// close: (mark: Mark) => {
|
|
320
|
-
// const token = new Token('code_inline', 'code', 0);
|
|
321
|
-
// token.content = 'TODO_INLINE_CODE';
|
|
322
|
-
// // token.attrSet('content', node.attrs.content);
|
|
323
|
-
// // if (node.attrs.type) {
|
|
324
|
-
// // }
|
|
325
|
-
// return token;
|
|
326
|
-
// },
|
|
327
|
-
open: 'code_open',
|
|
328
|
-
close: 'code_close',
|
|
329
|
-
escape: false,
|
|
330
|
-
},
|
|
331
|
-
// code: {
|
|
332
|
-
// open(_state, _mark, parent, index) {
|
|
333
|
-
// return backticksFor(parent.child(index), -1);
|
|
334
|
-
// },
|
|
335
|
-
// close(_state, _mark, parent, index) {
|
|
336
|
-
// return backticksFor(parent.child(index - 1), 1);
|
|
337
|
-
// },
|
|
338
|
-
// escape: false,
|
|
339
|
-
// }, // bookmark: {
|
|
340
|
-
// open(state, mark) {
|
|
341
|
-
// const id = mark.attrs.id;
|
|
342
|
-
// if (state.alreadyOutputedIds.has(id)) {
|
|
343
|
-
// return '';
|
|
344
|
-
// }
|
|
345
|
-
// state.alreadyOutputedIds.add(id);
|
|
346
|
-
// return `<a id="${id}"></a>`;
|
|
347
|
-
// },
|
|
348
|
-
// close() {
|
|
349
|
-
// return '';
|
|
350
|
-
// },
|
|
351
|
-
// },
|
|
352
|
-
});
|
|
353
|
-
document = removeMarkedContent(document, schema.marks.change);
|
|
354
|
-
// deleteAllMarkedText('change', state, dispatch)
|
|
355
|
-
const tokens = defaultMarkdownTokenizer.serialize(document);
|
|
356
|
-
if (config.debugTokens) {
|
|
357
|
-
const event = new CustomEvent('md:tokens', {
|
|
358
|
-
detail: {
|
|
359
|
-
tokens,
|
|
360
|
-
},
|
|
361
|
-
});
|
|
362
|
-
editor.dispatchEvent(event);
|
|
363
|
-
}
|
|
364
|
-
const markdownSerializerConfig = {
|
|
365
|
-
debug: config.serializerDebug,
|
|
366
|
-
};
|
|
367
|
-
const serializer = new MarkdownSerializer(markdownSerializerConfig);
|
|
368
|
-
const output = serializer.serialize(tokens);
|
|
369
|
-
const event = new CustomEvent('md:output', {
|
|
370
|
-
detail: {
|
|
371
|
-
output,
|
|
372
|
-
},
|
|
373
|
-
});
|
|
374
|
-
editor.dispatchEvent(event);
|
|
375
|
-
const debugMap = {};
|
|
376
|
-
const rawTextMap = [];
|
|
377
|
-
let sourceMap;
|
|
378
|
-
if (config.sourceMap) {
|
|
379
|
-
// https://sourcemaps.info/spec.html
|
|
380
|
-
// https://evanw.github.io/source-map-visualization/
|
|
381
|
-
// https://github.com/evanw/source-map-visualization/blob/gh-pages/code.js
|
|
382
|
-
const debugOutput = new SmartOutput();
|
|
383
|
-
nodeToTreeStringOutput(debugOutput, document);
|
|
384
|
-
debugOutput.getSourceMap((targetRow, targetCol, pos, item) => {
|
|
385
|
-
if (!item) {
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
debugMap[item.pos] = {
|
|
389
|
-
targetRow,
|
|
390
|
-
targetCol,
|
|
391
|
-
};
|
|
392
|
-
});
|
|
393
|
-
sourceMap = output.getSourceMap((targetRow, targetCol, targetPos, item) => {
|
|
394
|
-
if (item?.map) {
|
|
395
|
-
const pos = item.map[0];
|
|
396
|
-
const sourceCol = item.map[2];
|
|
397
|
-
rawTextMap.push({
|
|
398
|
-
nodeIdx: pos,
|
|
399
|
-
targetPos,
|
|
400
|
-
targetRow,
|
|
401
|
-
targetCol,
|
|
402
|
-
sourceCol,
|
|
403
|
-
});
|
|
404
|
-
if (debugMap[pos]) {
|
|
405
|
-
return {
|
|
406
|
-
sourceNo: 0,
|
|
407
|
-
sourceRowPos: debugMap[pos].targetRow,
|
|
408
|
-
sourceColPos: debugMap[pos].targetCol,
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
sourceMap.file = 'target.md';
|
|
414
|
-
sourceMap.sources = ['debug.txt'];
|
|
415
|
-
sourceMap.sourcesContent = [debugOutput.toString()];
|
|
416
|
-
}
|
|
417
|
-
if (config.dispatchSourceMap) {
|
|
418
|
-
const event = new CustomEvent('md:sourcemap', {
|
|
419
|
-
detail: {
|
|
420
|
-
sourceMap,
|
|
421
|
-
debugMap,
|
|
422
|
-
rawTextMap,
|
|
423
|
-
},
|
|
424
|
-
});
|
|
425
|
-
editor.dispatchEvent(event);
|
|
426
|
-
}
|
|
427
|
-
return {
|
|
428
|
-
content: output.toString(),
|
|
429
|
-
sourceMap,
|
|
430
|
-
debugMap,
|
|
431
|
-
rawTextMap,
|
|
432
|
-
};
|
|
433
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TokenHandler } from '../MarkdownSerializer.js';
|
|
2
|
-
export declare function getHtmlBasicTokensHandlers(): Record<string, Array<TokenHandler>>;
|
|
3
|
-
export declare function getBasicTokensHandlers(): Record<string, Array<TokenHandler>>;
|
|
4
|
-
//# sourceMappingURL=basic_token_handlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"basic_token_handlers.d.ts","sourceRoot":"","sources":["../../../../src/extension-markdown/src/token_handlers/basic_token_handlers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,0BAA0B,CAAC;AAGlC,wBAAgB,0BAA0B,IAAI,MAAM,CAClD,MAAM,EACN,KAAK,CAAC,YAAY,CAAC,CACpB,CAuDA;AAgBD,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CA4G5E"}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { getInlineTokensHandlers } from './inline_token_handlers.js';
|
|
2
|
-
export function getHtmlBasicTokensHandlers() {
|
|
3
|
-
return {
|
|
4
|
-
'frontmatter': [],
|
|
5
|
-
'heading_open': [
|
|
6
|
-
(token, ctx) => {
|
|
7
|
-
ctx.current.log(`<${token.tag}>`, token);
|
|
8
|
-
},
|
|
9
|
-
],
|
|
10
|
-
'heading_close': [
|
|
11
|
-
(token, ctx) => {
|
|
12
|
-
ctx.current.log(`</${token.tag}>\n`, token);
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
'paragraph_open': [
|
|
16
|
-
(token, ctx) => {
|
|
17
|
-
ctx.current.log('<p>', token);
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
'paragraph_close': [
|
|
21
|
-
(token, ctx) => {
|
|
22
|
-
ctx.current.log('</p>\n', token);
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
'fence': [
|
|
26
|
-
(token, ctx) => {
|
|
27
|
-
ctx.current.log('<pre>' + token.content + '</pre>\n', token);
|
|
28
|
-
// ctx.current.log('```' + token.info + '\n' + token.content + '```\n\n', token);
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
'code_block': [
|
|
32
|
-
(token, ctx) => {
|
|
33
|
-
ctx.current.log('<pre>' + token.content + '</pre>\n', token);
|
|
34
|
-
// ctx.current.log(
|
|
35
|
-
// token.content
|
|
36
|
-
// .split('\n')
|
|
37
|
-
// .map((t) => t ? (' ' + t) : '')
|
|
38
|
-
// .join('\n') + '\n', token
|
|
39
|
-
// );
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
'hr': [
|
|
43
|
-
(token, ctx) => {
|
|
44
|
-
ctx.current.log('<hr />\n', token);
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
'html_block': [
|
|
48
|
-
(token, ctx) => {
|
|
49
|
-
ctx.current.log(token.content, token);
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function getHeaderTokensHandlers() {
|
|
55
|
-
const entriesBasic = Object.entries(getBasicTokensHandlers())
|
|
56
|
-
.filter((entry) => ['heading_close'].includes(entry[0]));
|
|
57
|
-
const entriesInline = Object.entries(getInlineTokensHandlers())
|
|
58
|
-
.filter((entry) => ['text', 'link_open', 'link_close'].includes(entry[0]));
|
|
59
|
-
return {
|
|
60
|
-
...Object.fromEntries(entriesInline),
|
|
61
|
-
...Object.fromEntries(entriesBasic),
|
|
62
|
-
'default': [],
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export function getBasicTokensHandlers() {
|
|
66
|
-
return {
|
|
67
|
-
'frontmatter': [
|
|
68
|
-
(token, ctx) => {
|
|
69
|
-
ctx.current.log('---' + '\n' + token.content + '\n---\n\n', token);
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
'heading_open': [
|
|
73
|
-
(token, ctx) => {
|
|
74
|
-
ctx.stash('getBasicTokensHandlers.heading_open');
|
|
75
|
-
ctx.current.handlers = getHeaderTokensHandlers();
|
|
76
|
-
if (token.markup === '---') {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
ctx.current.log('#'.repeat(+token.tag.substring(1)) + ' ', token);
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
'heading_close': [
|
|
83
|
-
(token, ctx) => {
|
|
84
|
-
if (token.markup === '---') {
|
|
85
|
-
ctx.current.log('\n' + token.markup + '\n', token);
|
|
86
|
-
}
|
|
87
|
-
ctx.current.log('\n', token);
|
|
88
|
-
ctx.unstash('getBasicTokensHandlers.heading_close');
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
'paragraph_open': [
|
|
92
|
-
(token, ctx) => {
|
|
93
|
-
ctx.current.log('', token);
|
|
94
|
-
// Skip, as paragraphs are implied by newlines
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
'paragraph_close': [
|
|
98
|
-
(token, ctx) => {
|
|
99
|
-
if (ctx.output.colPos !== 0) {
|
|
100
|
-
ctx.current.log('\n', token);
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
'fence': [
|
|
105
|
-
(token, ctx) => {
|
|
106
|
-
const content = token.content.endsWith('\n')
|
|
107
|
-
? token.content
|
|
108
|
-
: token.content + '\n';
|
|
109
|
-
if (token.info === 'latex') {
|
|
110
|
-
ctx.current.log('$$' + '\n' + content + '$$\n\n', token);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
const lang = token.attrGet('lang') || '';
|
|
114
|
-
ctx.current.log('```' + lang + '\n' + content + '```\n\n', token);
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
],
|
|
118
|
-
'code_block': [
|
|
119
|
-
(token, ctx) => {
|
|
120
|
-
const indent = +(token.attrGet('indent') || 0);
|
|
121
|
-
const lang = token.attrGet('lang') || '';
|
|
122
|
-
if (indent === 0) {
|
|
123
|
-
const content = token.content.endsWith('\n')
|
|
124
|
-
? token.content
|
|
125
|
-
: token.content + '\n';
|
|
126
|
-
if (lang === 'latex') {
|
|
127
|
-
ctx.current.log('$$' + '\n' + content + '$$\n\n', token);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
ctx.current.log('```' + lang + '\n' + content + '```\n\n', token);
|
|
131
|
-
}
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
ctx.current.log(token.content
|
|
135
|
-
.split('\n')
|
|
136
|
-
.map((t) => t ? (' '.repeat(indent) + t) : '')
|
|
137
|
-
.join('\n'), token);
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
'hr': [
|
|
141
|
-
(token, ctx) => {
|
|
142
|
-
ctx.current.log((token.markup || '---') + '\n', token);
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
'html_block': [
|
|
146
|
-
(token, ctx) => {
|
|
147
|
-
ctx.current.log(token.content, token);
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
};
|
|
151
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"footnote_token_handlers.d.ts","sourceRoot":"","sources":["../../../../src/extension-markdown/src/token_handlers/footnote_token_handlers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,yBAAyB,IAAI,MAAM,CACjD,MAAM,EACN,KAAK,CAAC,YAAY,CAAC,CACpB,CAiCA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export function getFootnoteTokensHandlers() {
|
|
2
|
-
return {
|
|
3
|
-
'footnote_block_open': [
|
|
4
|
-
(token, ctx) => {
|
|
5
|
-
},
|
|
6
|
-
],
|
|
7
|
-
'footnote_block_close': [
|
|
8
|
-
(token, ctx) => {
|
|
9
|
-
},
|
|
10
|
-
],
|
|
11
|
-
'footnote_open': [
|
|
12
|
-
(token, ctx) => {
|
|
13
|
-
if (token.meta.label) {
|
|
14
|
-
ctx.current.log(`[^${token.meta.label}]: `, token);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
ctx.current.log(`[^footnote_${token.meta.id}]: `, token);
|
|
18
|
-
}
|
|
19
|
-
ctx.stash('getFootnoteTokensHandlers.footnote_open');
|
|
20
|
-
ctx.current.footnoteCnt++;
|
|
21
|
-
ctx.current.itemRow = 0;
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
'footnote_close': [
|
|
25
|
-
(token, ctx) => {
|
|
26
|
-
ctx.unstash('getFootnoteTokensHandlers.footnote_close');
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
'footnote_anchor': [
|
|
30
|
-
(token, ctx) => {
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
};
|
|
34
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Token } from '../types.js';
|
|
2
|
-
import type { TokenHandler } from '../MarkdownSerializer.js';
|
|
3
|
-
export declare function escapeMarkdown(token: Token): Array<[string, Token]>;
|
|
4
|
-
export declare function getInlineTokensHandlers(): Record<string, Array<TokenHandler>>;
|
|
5
|
-
export declare function getHtmlInlineTokensHandlers(): Record<string, Array<TokenHandler>>;
|
|
6
|
-
//# sourceMappingURL=inline_token_handlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inline_token_handlers.d.ts","sourceRoot":"","sources":["../../../../src/extension-markdown/src/token_handlers/inline_token_handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CA4EnE;AAwDD,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAqJ7E;AAMD,wBAAgB,2BAA2B,IAAI,MAAM,CACnD,MAAM,EACN,KAAK,CAAC,YAAY,CAAC,CACpB,CA4IA"}
|