nvim-neorg / rust-norg

A robust parser for Norg for tools that don't use tree-sitter.
11 stars 4 forks source link

Fix Whitespace Handling in VerbatimRangedTag to Preserve Source Code Formatting #11

Open evpeople opened 1 month ago

evpeople commented 1 month ago

In the current implementation of VerbatimRangedTag, all whitespace is ignored within the content. This prevents the preservation of source code formatting during export. Should this be modified?

evpeople commented 1 month ago

I removed

    let newline = parse_newline
        // .then_ignore(ws.repeated())
        .to(NorgToken::SingleNewline);

the then_ignore in newline and newlines the it can keep the code format, but I am not sure whether it breaks other things.

I first tried to make changes in stage_3 to ensure minimal impact, but logging revealed that it was already too late.