feat(render): list_ignore_newline / text_ignore_newline = false → <br>
CI / cargo fmt --check (push) Failing after 22s
CI / cargo clippy (push) Successful in 22s
CI / cargo test (push) Successful in 36s
CI / editor keymaps (push) Successful in 1m26s

Implements the deferred half of these options: a soft line break inside a
paragraph / list item can render as <br /> instead of a space.

- Parser: soft breaks now emit a dedicated InlineNode::SoftBreak node
  (parse_inline_seq K::Newline + the list-continuation synthetic join) instead
  of collapsing to Text(" "). Added SoftBreakNode + the variant.
- All inline consumers treat SoftBreak as whitespace: AST visitor (no-op),
  text extraction (index.rs + lib.rs → space), nav/semantic_tokens span_of_inline,
  semantic emit (skip like Text), parser span_of_inline.
- Renderer: render_inlines_break renders top-level SoftBreaks as the
  context-specific string; render_paragraph uses text_ignore_newline,
  render_list_item uses list_ignore_newline; default render_inline → space.
  with_newline_handling builder; export.rs wires both from HtmlConfig.

Default (true/true = upstream default) behaviour is unchanged (space). Updated
3 core tests + 1 parser test that asserted the old Text(" ") shape to treat
SoftBreak as whitespace. New test render_page_html_ignore_newline_controls_soft_breaks.

Gap doc: P3 Config item closed — only the deferred markdown cluster remains.
Full rust suite + clippy clean; Neovim 307, Vim 301/18/21.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-03 13:06:38 +00:00
parent 1246c99c3c
commit e6e3f70dd2
14 changed files with 122 additions and 26 deletions
+9 -7
View File
@@ -594,13 +594,15 @@ fix site.
`[[#anchor]]` (no description) vs `0``[[#anchor|title]]`. **`markdown_link_ext`
stays deferred** — part of the markdown generated-content cluster (see the
divergence note below).
- [ ] **`list_ignore_newline` / `text_ignore_newline`** — config keys round-trip
(`HtmlConfig`, default `true` = upstream's default, which nuwiki already
honours: soft newlines render as spaces). The **`false``<br>`** behaviour
is **deferred**: the parser collapses soft breaks to spaces before the
renderer sees them, so `=false` needs a parser-level soft-break node (risky;
touches every parse consumer). Documented as a parser limitation; the common
default works.
- [x] **`list_ignore_newline` / `text_ignore_newline`** _(fixed 2026-06-03)_
the parser now emits a dedicated `InlineNode::SoftBreak` for soft line breaks
(instead of collapsing to `Text(" ")`); every inline consumer (visitor,
renderer, semantic tokens, nav, text extraction) treats it as whitespace. The
HTML renderer renders it as a space (`= true`, default) or `<br />`
(`= false`), distinguishing paragraph (`text_ignore_newline`) from list-item
(`list_ignore_newline`) context via `render_inlines_break` +
`with_newline_handling`. Test
`render_page_html_ignore_newline_controls_soft_breaks` (`html_export.rs`).
### Mappings
- [x] **Visual `<CR>` normalize-link** _(fixed 2026-06-03)_ — upstream binds