Skip to content

fix: keep cleaned HTML inside list items and strip annotated imports - #90

Merged
rachfop merged 1 commit into
mainfrom
fix/review-followups
Oct 2, 2026
Merged

rachfop merged 1 commit into
mainfrom
fix/review-followups

Conversation

@rachfop

@rachfop rachfop commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Follow-ups from reviewing the content-cleaning fixes:

  • HTML block tags inside a list item (- item\n <p>para</p>) were replaced with a newline at column 0, which ended the list item and split the list. A line that starts with a block tag now takes the content indentation of the list item it continues, and a mid-line tag breaks onto that indentation. Outside a list the indentation is dropped, so indented HTML can't become a code block. 20,000 indented tags clean in about 20 ms.
  • With excludeImports, imports with a trailing comment or an import attribute (with { type: 'json' }) were left in the output.

tests/test-review-followups.js covers both. The docs site output is unchanged from main. On a 3,461-page docs site, the differences are blank lines removed and text inside list items keeping its indentation.

- Block tags (`<p>`, `<div>`, `<br>`, ...) turned into a newline at
  column 0, so text inside a list item ended the item and split the list.
  A tag at the start or end of a line is dropped; a line it starts takes
  the content indentation of the list item it continues (outside a list,
  no indentation, so it can't become a code block); a mid-line tag breaks
  the line onto the item's indentation. List context is computed in one
  pass, so large indented HTML stays linear.
- With excludeImports, an import with a trailing comment or an import
  attribute (`with { type: 'json' }`) was left in the output.
@rachfop
rachfop merged commit 155669b into main Oct 2, 2026
5 checks passed
@rachfop
rachfop deleted the fix/review-followups branch October 2, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant