From bfd22bb6fae61d9cd26148cb2bfd46c8702fd24a Mon Sep 17 00:00:00 2001 From: jutty Date: Thu, 1 Jan 2026 21:45:58 -0300 Subject: [PATCH] Improve forced flanking node rendering --- src/syntax/content/parser.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/syntax/content/parser.rs b/src/syntax/content/parser.rs index cfe9563..08893b0 100644 --- a/src/syntax/content/parser.rs +++ b/src/syntax/content/parser.rs @@ -124,6 +124,12 @@ fn lex(text: &str, map: LexMap, config: &Config) -> Vec { if candidate.leading && lexeme.text() == "|" { // third pipe immediately after second: forcing flanking if lexeme.match_next_first_char('|') { + candidate.destination = + Some(candidate.text.clone()); + let token = Token::Anchor(candidate.clone()); + tokens.push(token); + state.context.inline = InlineContext::None; + iterator.next(); continue; // whitespace or punctuation after pipe: flanking anchor } else if lexeme.is_next_whitespace() @@ -295,6 +301,14 @@ mod tests { ); } + #[test] + fn force_flanking_with_trailing_letter() { + assert_eq!( + read_noconfig("|Node||s"), + r#"

Nodes

"# + ); + } + #[test] fn flanking_with_trailing_pipe() { assert_eq!(