WGUNDERWOOD / tex-fmt

An extremely fast LaTeX formatter written in Rust
MIT License
265 stars 20 forks source link

Create test files for moving sectioning commands to their own line #36

Closed cdesaintguilhem closed 1 month ago

cdesaintguilhem commented 1 month ago

This PR is related to #13; it adds two test files that capture the expected behaviour for formatting sectioning commands: if such a command is on a line with other text, it should be moved to its own line. This should apply to all sectioning commands present on the same line. However (as discussed), no new empty lines should be added around the new line to which the sectioning command was moved.

WGUNDERWOOD commented 1 month ago

Thanks for this. Of course, the new tests do not pass at the moment, so I will leave this open until the feature has been implemented.

WGUNDERWOOD commented 1 month ago

Can this behaviour be implemented using the new regexes introduced in #42 ?

cdesaintguilhem commented 1 month ago

Most probably, yes. Now that #42 has been merged, I can base a branch on that and check whether it's enough to use the existing splitting regex with maybe an additional one for the needs_new_line logic.

cdesaintguilhem commented 1 month ago

Closing this PR because it's superseded by #45.