/** * Is `line` a BLOCK code-fence delimiter (open or close) that should toggle an * `inFence` state machine? A line whose leading `` ``` `` / `~~~` run is CLOSED by * another run of the SAME fence char ON THE SAME LINE is a self-contained INLINE span * (e.g. `` ```code``` text ``) — NOT a block fence — so it must NOT toggle. This mirrors * how the parser's `stripCodeAndInline` consumes an inline span as one unit, keeping every * line walker in agreement with the parser. * * Leading whitespace is allowed (CommonMark permits up to 3 spaces of indent). Returns * `false` for a plain line, an inline code span (`` `x` ``), or a bare non-fence line. * * @example * opensBlockFence("```"); // true (bare open/close) * opensBlockFence("```js"); // true (info-string open) * opensBlockFence(" ~~~"); // true (indented fence) * opensBlockFence("```inline``` text"); // false (self-contained inline span) * opensBlockFence("plain text"); // false */ export declare function opensBlockFence(line: string): boolean; /** The fence character (`` ` `` or `~`) if `line` is a BLOCK code-fence delimiter, else null. * A leading run closed by another same-char run on the SAME line is an inline span → null. */ export type FenceChar = "`" | "~"; export declare function blockFenceDelimiter(line: string): FenceChar | null; /** * Advance a CHAR-AWARE fence state machine by one line. Returns the new open-fence * marker (the char that opened the current block, or null when outside) and whether * this line is a block-fence DELIMITER (an open, or a CLOSE whose char matches the open). * * v3.11.5-rc.5 (meta-audit) — the correct pattern to replace the char-BLIND `inFence = * !inFence` toggle: a `` ``` `` line inside a `~~~` block (or vice versa) is LITERAL code, * NOT a delimiter, so it must not flip the state — matching CommonMark + the parser's * `stripCodeAndInline` (which pairs ``` with ``` and ~~~ with ~~~ independently). Only * fts5's breadcrumb walker tracked this; write.ts/read.ts/meta.ts used the blind toggle, * so a mismatched inner fence corrupted rename/replace edits, the heading map, and * open-questions. Callers: `const s = advanceFence(line, marker); marker = s.marker; if * (s.delimiter) {…continue…} if (marker !== null) {…in-fence…}`. */ export declare function advanceFence(line: string, marker: FenceChar | null): { marker: FenceChar | null; delimiter: boolean; }; //# sourceMappingURL=fence.d.ts.map