Release RuneStone 0.1.3 and expand plugin plans

This commit is contained in:
Knotty Wyvern
2026-10-03 04:23:45 -07:00
parent 43106ed9c7
commit 0268c5c9f0
44 changed files with 247 additions and 53 deletions
+10 -4
View File
@@ -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) {