Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't include extra linebreak positions after an explicit break. #1003

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Sep 14, 2023

This PR fixes a problem with CHTML output where in-line expressions with explicit line breaks could end up with extra vertical space at the explicit break if the part after it starts with an operator and is too wide for the container. To do with, we mark the nodes with explicit linebreaks, and if we are just after an explicit line break, we don't mark an operator as breakable (preventing an extra line break from occurring right after an explicit one). In the CHTML output, we don't insert breakpoints before explicit linebreaks (preventing an extra line break from occurring before that).

A test case is to use

<div style="width:5em; border: 1px solid black">
\(a + \text{bbbbbbbbbbbbbbbbb} \\ = \text{cccccccccccccccc} + d\)
</div>

to see that there are no extra blank lines in CHTML output.

@dpvc dpvc requested a review from zorkow September 14, 2023 15:03
@dpvc dpvc added this to the v4.0 milestone Sep 14, 2023
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@dpvc dpvc merged commit 55699fb into develop Sep 15, 2023
@dpvc dpvc deleted the issue3098c branch September 15, 2023 18:36
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.

None yet

2 participants