fix: Change inline and block delimiters

This commit is contained in:
Hwang In Tak 2024-09-25 00:10:49 +09:00
parent e48d66f918
commit 3f1255b39e
No known key found for this signature in database

View File

@ -1,14 +1,14 @@
import katex from 'katex'; import katex from 'katex';
const DELIMITER_LIST = [ const DELIMITER_LIST = [
{ left: '$$\n', right: '\n$$', display: true },
{ left: '$$', right: '$$', display: false }, // This should be on top to prevent conflict with $ delimiter
{ left: '$', right: '$', display: false }, { left: '$', right: '$', display: false },
{ left: '$$', right: '$$', display: true },
{ left: '\\pu{', right: '}', display: false }, { left: '\\pu{', right: '}', display: false },
{ left: '\\ce{', right: '}', display: false }, { left: '\\ce{', right: '}', display: false },
{ left: '\\(', right: '\\)', display: false }, { left: '\\(', right: '\\)', display: false },
{ left: '( ', right: ' )', display: false }, { left: '\\[\n', right: '\n\\]', display: true },
{ left: '\\[', right: '\\]', display: true }, { left: '\\[', right: '\\]', display: false },
{ left: '[ ', right: ' ]', display: true }
]; ];
// const DELIMITER_LIST = [ // const DELIMITER_LIST = [
@ -55,8 +55,8 @@ const { inlineRule, blockRule } = generateRegexRules(DELIMITER_LIST);
export default function (options = {}) { export default function (options = {}) {
return { return {
extensions: [ extensions: [
inlineKatex(options),
blockKatex(options), blockKatex(options),
inlineKatex(options),
] ]
}; };
} }