Line breaks inside multi-line HTML comments are collapsed
- Dominant language
- Python
- Stars
- 81
- Forks
- 11
- Avg merge
- 10h 53m
- Merged PRs (30d)
- 6
Description
## Summary
When an HTML comment spans multiple lines, flowmark collapses the internal line breaks, joining all content onto a single line. Flowmark already preserves line breaks *around* HTML comment tags (before/after ``), but does not preserve line breaks *within* them.
## Version
flowmark 0.6.4
## Reproduction
Run `flowmark --auto` on a markdown file containing multi-line HTML comments:
```markdown
```
## Observed behavior
All internal line breaks are collapsed to a single line:
```markdown
```
This produces lines that can exceed 300+ characters for comments with many attributes.
## Expected behavior
Line breaks within HTML comments should be preserved as-is. The internal formatting of comments is intentional and should not be reflowed.
## Use case
[Markform](https://github.com/jlevy/markform) uses HTML comments with structured attributes for form field definitions. These are intentionally formatted across multiple lines for readability, with attributes like `columnIds`, `columnLabels`, and `columnTypes` on separate lines. Collapsing them makes them very hard to read and review in diffs.
This likely also affects any other use of multi-line HTML comments in markdown (e.g., template directives, metadata annotations, etc.).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.