elvirbrk / NoteHighlight2016

Source code syntax highlighting for OneNote 2016 and OneNote for O365 . NoteHighlight 2013 port for OneNote 2016 (32-bit and 64-bit)
GNU General Public License v2.0
3.84k stars 393 forks source link

Formatting fails depending on surrounding text #169

Open TonyGravagno opened 2 years ago

TonyGravagno commented 2 years ago

If there is a line of text above or below selected text to be highlighted, the formatting fails. If the first line of selected text is not left-aligned, formatting fails.

"Failure" is a result where only part of the code is formatted and the rest is truncated, or maybe all of the code is deleted. (Ctrl-Z to recover)

Examples:

This describes a block of code:
code_line1
code_line2
This summarizes the code.

If the two lines of code are selected where they are, from 'c' in line1 to '2' in line2, formatting fails. Separation is required:

This describes a block of code, preceded by an empty line: 

code_line1
code_line2

This summarizes the code, which is followed by an empty line.

If the code is indented, formatting fails:

This describes a block of code, preceded by an empty line: 

    code_line1_indented
         code_line2 (indented or not)

This summarizes the code, which is followed by an empty line.

I suspect this is related to the issue reported in #90.

HTH