Open soylomass opened 6 months ago
function disableIndentedCode() {
const data = this.data();
add("micromarkExtensions", {
disable: { null: ["codeIndented"] },
});
/**
* @param {string} field
* @param {unknown} value
*/
function add(field, value) {
const list /** @type {Array<unknown>} */ =
// Other extensions
/* c8 ignore next 2 */
data[field] ? data[field] : (data[field] = []);
list.push(value);
}
}
const parserOptions = {
remark: {
plugins: {
["disable-indented-code"]: {
instance: disableIndentedCode,
},
},
},
};
<MDC
:value="element.text"
class="markdown-body"
:parser-options="parserOptions"
/>
Tried with this solution, but it breaks the rendering of the strings where said syntax is included (the whole string is not rendered). Strings without said syntax are rendered normally.
Is there any way to disable specific markdown syntax? In my case, I need to disable indented code blocks, leaving only fenced code blocks. Is it possible?