How should non-standard (not CR/LF) line-breaks be treated?
See original GitHub issueFor example, HTML newlines are LF, CRLF, CR,
The newline characters of CSS are LF, CRLF, CR and FF,
The newline characters of JS are LF, CRLF, CR, LS, PS.
Then the .html
file as follows:
<style><FF></style><CR><script><LS></script>
It should be shown as (following the outermost mode):
<style></style>
<script></script>
Or (following the pattern of each layer itself):
<style>
</style>
<script>
</script>
?
At present, the mainstream editors do not care about the inner and outer layers at all. In fact, even if they are single language, they do not care about newline characters except LF, CRLF and CR. The difficulty of implementation is not considered here, but the rationality scale itself is only considered from the programming point of view.
Another edge case is that if there are fewer line breaks allowed in the inner layer than in the outer layer, then there are line breaks in the inner layer that are not converted in the inner layer but can be converted in the outer layer. How should the line number be displayed? Or is it that any language that can be nested avoids this when it is designed?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Small issue with the wording, we aren’t an “editor”… I’ll update. I’ve given this a bit of thought just now… and my thought is only in the context of web usage. I have no thoughts outside that - and now one has brought this up as an issue (other than this hypothetical), and it would have to get a little less theoretical I think for me to have thoughts.
I’m currently just not sure any of these new ways to break a line matter at all. 😃
So, for web usage…
I would suggest that correct (and expected) behavior is that code block should be structured the same BEFORE and AFTER syntax highlighting other than color/italics/bold/etc. IE, highlighting a snippet should NOT alter the visible whitespace… I don’t expect whitespace/line breaks to be added, and I don’t expect it to be removed.
Note I specifically didn’t say “preserved”… I said visually not-altered.
So, regarding the web, is the existing behavior broken now according to this expectation?
What are FF, LS, and PS non-abbreviated? I’m only familiar with CR/LF.