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

Rework inline formatting #5

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Rework inline formatting #5

merged 1 commit into from
Jan 8, 2024

Conversation

syeopite
Copy link
Owner

@syeopite syeopite commented Jan 8, 2024

Closes #4

This PR simplifies the convoluted method in which inline formatting was handled.

By splitting the overlapping inline formatting intervals into discrete slices that signifies how to style that slice, the logic for inline formatting can be simplified to a single loop instead of the recursive series of checks and dozens of while loops.

This improves performance, code clarity, and fixes some long-standing bugs in the renderer.

The caveat however is that the resulting HTML now has the chance to be much larger than before. This should be addressed as soon as possible.

Also fixes #2 albeit unintentionally

This commit simplifies the convoluted method in which inline
formatting was handled.

By splitting the overlapping inline formatting intervals into
discrete slices that signifies how to style that slice, the logic for
inline formatting can be simplified to a single loop instead of the
recursive series of checks and dozens of while loops.

This improves performance, code clarity, and fixes some long-standing
bugs in the renderer.

The caveat however is that the resulting HTML now has the chance to
be much larger than before. This should be addressed as soon as
possible.
@syeopite syeopite merged commit e72e22a into master Jan 8, 2024
3 checks passed
@syeopite syeopite deleted the inline-formatting-rework branch January 8, 2024 22:40
@syeopite syeopite mentioned this pull request Jan 8, 2024
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.

Rework inline formatting "Unreachable" exception in inline formatter reached
1 participant