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

Syntax highlighting of bold, italic etc. does not work across wrapped lines #100

Open
n2taylor opened this issue Mar 22, 2020 · 4 comments

Comments

@n2taylor
Copy link

n2taylor commented Mar 22, 2020

Best explained with an image:

sublime_zk_highlighting_bug

The last two examples there are just long lines that wrap around -- no line breaks. In this case my settings have "word_wrap": true and "wrap_width": 80.

Same happens on bold, underline etc.

@Derpius
Copy link

Derpius commented May 2, 2020

The word wrap setting likely adds a line break unicode char after 80 characters (to the nearest space so as to not chop up a word).

If you paste the text here so I can look at it, or open it in an un-formatted text editor so you can view whats hidden by unicode escape characters.

See attached a screenshot I cropped from the website I linked above showing what's likely happening.
Example


If this answers your question please close the issue yourself by pressing the close issue button, as the developer of this plugin appears to be inactive (no commits since two years ago, no resolved issues since around the same time etc.)

@Derpius
Copy link

Derpius commented May 2, 2020

Actually it's definitely a line break, I've just noticed the row numbers have no gaps, and sublime text shows 2 lines of text with no line break as a single row number the same as any other text editor.

@n2taylor
Copy link
Author

There is a newline, but isn't Markdown supposed to ignore newlines (\n) unless they have two spaces or another newline after them?
I would expect that the formatting carry over past the \n unless it was a hard line break via \n with two spaces, two \ns or a <br>.

@Derpius
Copy link

Derpius commented May 26, 2020

Markdown, as it is derived from HTML, doesn't place line breaks when viewed with formatting.
This stems from HTML's <br> tag, when you do a double space and a return it essentially add that break tag under the hood.

This is because in HTML, even if you add a line break in the code, it won't display in the browser, however it will take effect in the code to allow for more readable code.

Example:
This line actually has a **line break** in the raw text, as you can see by the double asterisks not making the text bold, but doesn't display one in the formatted version.

Whereas this

uses the HTML line break tag

Line breaks like these wont affect HTML tags as they span multiple lines, but can be hit or miss with markdown's equivalent as the syntax is less structured.

However none of that matters to the syntax highlighter which will stop at a line break in the code.
(Unless you're programming in a language that uses line terminators like C++, then the highlighter will ignore breaks for the most part)

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

No branches or pull requests

2 participants