Release RuneStone 0.1.3 and expand plugin plans
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import MarkdownIt from "markdown-it";
|
||||
import type { Token } from "markdown-it";
|
||||
import { inlineMathEnd } from "./inlineMath.ts";
|
||||
import { evaluateTableFormulas, formulaErrors, type FormulaResult } from "../editor/tableFormulas.ts";
|
||||
|
||||
const markdown = new MarkdownIt({ html: false, linkify: true, breaks: false });
|
||||
@@ -8,11 +9,16 @@ export const escapeHtml = markdown.utils.escapeHtml;
|
||||
// Inline note formats also round-trip through the table cell editor.
|
||||
markdown.inline.ruler.before("emphasis", "note_formats", (state, silent) => {
|
||||
const marker = ["==", "%%", "$"].find(value => state.src.startsWith(value, state.pos));
|
||||
if (!marker || (marker === "$" && state.src.startsWith("$$", state.pos))) return false;
|
||||
if (!marker) return false;
|
||||
let end = state.pos + marker.length;
|
||||
for (; end < state.posMax; end++) {
|
||||
if (state.src[end] === "\\") { end++; continue; }
|
||||
if (state.src.startsWith(marker, end)) break;
|
||||
if (marker === "$") {
|
||||
end = inlineMathEnd(state.src, state.pos, state.posMax);
|
||||
if (end < 0) return false;
|
||||
} else {
|
||||
for (; end < state.posMax; end++) {
|
||||
if (state.src[end] === "\\") { end++; continue; }
|
||||
if (state.src.startsWith(marker, end)) break;
|
||||
}
|
||||
}
|
||||
if (end >= state.posMax || end === state.pos + marker.length) return false;
|
||||
if (!silent) {
|
||||
|
||||
Reference in New Issue
Block a user