MCPcopy
hub / github.com/panphora/overtype / setCustomSyntax

Method setCustomSyntax

src/overtype.js:1951–1970  ·  view source on GitHub ↗

* Set custom syntax processor for extending markdown parsing * @param {Function|null} processor - Function that takes (html) and returns modified HTML * @example * OverType.setCustomSyntax((html) => { * // Highlight footnote references [^1] * return html.replace(/\[\^(\w

(processor)

Source from the content-addressed store, hash-verified

1949 * });
1950 */
1951 static setCustomSyntax(processor) {
1952 MarkdownParser.setCustomSyntax(processor);
1953
1954 // Update all existing instances
1955 document.querySelectorAll('.overtype-wrapper').forEach(wrapper => {
1956 const instance = wrapper._instance;
1957 if (instance && instance.updatePreview) {
1958 instance.updatePreview();
1959 }
1960 });
1961
1962 document.querySelectorAll('overtype-editor').forEach(webComponent => {
1963 if (typeof webComponent.getEditor === 'function') {
1964 const instance = webComponent.getEditor();
1965 if (instance && instance.updatePreview) {
1966 instance.updatePreview();
1967 }
1968 }
1969 });
1970 }
1971
1972 /**
1973 * Initialize global event listeners

Callers 2

cleanupFunction · 0.45

Calls 2

getEditorMethod · 0.80
updatePreviewMethod · 0.65

Tested by 1

cleanupFunction · 0.36