Ignore single-line highlight which is out of wrap section#3475
Ignore single-line highlight which is out of wrap section#3475RunDevelopment merged 3 commits intoPrismJS:masterfrom
Conversation
|
Thank you for the PR @lijyze! Unfortunately, I do not understand the problem you fixed. Could you please explain it in more detail? Maybe even provide some screenshots? |
|
@RunDevelopment Sorry for bad explanation. Let's say, if my code looks like this, it has only 3 lines of code. Now I want highlight some lines of it.
I think this make sense, it means highlight from the start of the range to the end of the code.
What have I done is ignore lines that exceed line numbers of code section when Thank you for reading this, I wish you a good day! |
|
Thank you for the detailed explanation! Instead of working around the different behavior of with and without So we could count the number of lines (once) and then do |
|
Similarly, we could also ignore (= not display) any ranges or single-lines if their |
|
Yeah! Your solution is much more elegant. |
|
Thank you for contributing @lijyze! |





When highlight a range, if its end line exceed the wrap section, prism highlight from start line of the rang to the end of wrap section. That's good.
When thing comes to a single line, prism highlight the last line of wrap section, that's weird.
So ,I make it a little different, if the single-line is out of wrap section, simply ignore this line.