flexmark-java icon indicating copy to clipboard operation
flexmark-java copied to clipboard

Parsing of markers starting with a letter

Open Jarda8 opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. I am converting Jira markup into another custom markup. When I tried to write a custom parser for Jira style headings (e. g. "h1. Some Heading" https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=headings), I bumped into a "little performance optimization" in DocumentParser, that skips all lines starting with a letter.

Describe the solution you'd like Introduce a parser option disabling this optimisation.

Additional context The code in question in DocumentParser.incorporateLine

// this is a little performance optimization:
if (blank || (indent < myParsing.CODE_BLOCK_INDENT && Parsing.isLetter(line, nextNonSpace))) {
    setNewIndex(nextNonSpace);
    break;
}

Jarda8 avatar Mar 22 '22 09:03 Jarda8