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

This fixes a bug and adds a feature #111

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

terhechte
Copy link

This PR contains a cleaned up version of #109. It also contains additional tests for AttributedString processing particularly because they make it easy to spot a bug where Splash introduces additional newlines at the top of source code. This PR also contains a fix for that bug.

This adds a test which fails because Splash inserts additional whitespace
at the beginning of code if the code has empty lines before it starts.
It seems that `\n` is identified as a valid token and then the same
substring (`\n`) is both inserted as whitespace and as a token.

This causes the insertion of additional whitespace at the beginning
of the code.
This would allow using a custom monospace font for highlighting.
This is especially useful if, say, the code is embedded into some sort of presentation 😊.
An assert could be added to make sure the font is monospace,
but I feel like that's not required.

If somebody wants to display their code in Comic Sans, all the more power to them
@jefferycline1
Copy link

😀

Copy link

@Jagger1976 Jagger1976 left a comment

Choose a reason for hiding this comment

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

Thanx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants