Skip to content

isLineStateResumable

Whether highlighting from a copy of a state gives what the parse that reached it gives from there on.

A state inside a fenced code block, or inside a script or style element of an HTML block, is not. It holds a CodeMirror 5 mode made for that block when the block opened, and such a mode can keep state of its own between tokens, outside the state: the CSS mode keeps the last token’s type, and a - it reads no token from takes that type. A copy of the state shares the mode, so what the lines after it give depends on what that mode object tokenized last. A resume before the block makes the mode again when the block opens, as a parse from the start does.

Import:

import { isLineStateResumable } from '@mnaoumov/obsidian-markdown-parser';

Signature:

function isLineStateResumable(state: ObsidianState): boolean

Parameters:

Parameter Type Description
state ObsidianState The state after a line.

Returns: boolean — true when the state is a resume point.