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

Fix handling of newlines in classed HTML #307

Merged
merged 2 commits into from
Dec 1, 2020
Merged

Conversation

trishume
Copy link
Owner

The examples used the _newlines syntax without providing newlines,
leading to occasional broken highlighting (#303). The function for producing
classed HTML added newlines for you so I deprecated that one and
added a new one which doesn't, so that I could change the examples to
use the _newlines variant in the proper way.

cc @mitnk @uwearzt @quasicomputational

The examples used the `_newlines` syntax without providing newlines
leading to broken highlighting (#303). The function for producing
classed HTML added newlines for you so I deprecated that one and
added a new one which doesn't, so that I could change the examples to
use the `_newlines` variant in the proper way.
src/html.rs Outdated
///
/// let syntax_set = SyntaxSet::load_defaults_newlines();
/// let syntax_set = SyntaxSet::load_defaults_nonewlines();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this right? IIUC, either this needs to change, or the code feeding the HTML generator needs to change, but not both?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Took me a while to get around to this but you're very right thanks for catching this.

@quasicomputational
Copy link
Contributor

That nit aside, LVGTM - it fixed a mis-highlighting that I'd been meaning to get around to investigating for a while now, which is handy indeed!

@trishume trishume merged commit f6a7ad8 into master Dec 1, 2020
@trishume trishume deleted the fix-classed-html-newlines branch December 1, 2020 04:39
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.

2 participants