-
Notifications
You must be signed in to change notification settings - Fork 60
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 colour highlighting of HTML with JSON context in JavaScript section #214
Comments
See earlier Escape of EOL in JS string does not work. |
@nyamatongwe |
@ajtruckle It is like a note to self as reference. Still as you mention, related to backslash escape though none in the examples at end of line like your example. @nyamatongwe My curiosity tingles as why single quotes have different styling behaviour to double quotes in Javascript when they are supposed to be interchangable. Double quotes: Lines 2175 to 2178 in 6a977a3
Single quotes: Lines 2188 to 2193 in 6a977a3
I would expect these 2 code blocks to be the same. Surely one is right and the other is not. This is why I mentioned the workaround of trying single quotes in the linked post at Notepad++ as an immediate action to correct the styling. Reference: https://www.javascript.com/learn/strings |
An issue will often be examined by multiple people and they may accumulate links to reference documents (what does the standard say?) and code history. Its unlikely I'll write a patch for this but I checked git log and git blame to see what occurred. Looking at the history can indicate if this was a deliberate choice - its easy to unfix things. The bug led to change 3fa9084.
The issue is poorly formatted and a newline can be seen in the first line of script if edit (only admins) is pressed. <script type="text/javascript">//<![CDATA[
var x = '<table>\
</table>'; Possibly the poster battled mark-up and lost or it was a victim of SourceForge changing over time. This was originally bug #3038381 as listed in Lexilla history before SourceForge renumbered all the issues. I have updated the formatting to show the intention.
Some languages have different escape rules for different string quotes so there may be historical reasons or it may just be that the contributor wasn't aware they should be the same. |
@nyamatongwe Thanks for the information. I did not consider the markdown at Scintilla got messed up, my mistake. As they say, "don't fix if not broke". The bug fix done by Stephen Deibel appears to work with single quoted strings and I cannot seem to break it, so I'll go with the option to apply the same fix to the double quoted strings. |
I appreciate your closing the issue. But Notepad++ still renders my file as I originally reported. Does this commit mean Notepad++ will have another update with the newer editor control? |
@ajtruckle The issue is fixed and closed here at Lexilla. Lexilla 5.3.0 has been released with this fix. Notepad++ will probably have a Pull Request submitted in a few days to merge the new releases of Scintilla and Lexilla. Time may depend on the holiday season. If everything goes OK, the next release of Notepad++ will have this fix. In SciTE 5.4.1 which has been just released with the fix looks like: If you want the fix any quicker, then you may need to compile Notepad++ yourself with the fix.
Expectation is yes as to the routine of Notepad++. |
Scintilla 5.4.1 https://www.scintilla.org/scintilla541.zip Released 27 December 2023. 1. Add IDocumentEditable interface to allow efficient interaction with document objects which may not be visible in a Scintilla instance. This feature is provisonal and may change before being declared stable. For better type-safety, the ScintillaCall C++ API uses IDocumentEditable* where void* was used before which may require changes to client code that uses document pointer APIs DocPointer, SetDocPointer, CreateDocument, AddRefDocument, and ReleaseDocument. 2. Ctrl-click on a selection deselects it in multiple selection mode. 3. Add SCI_SELECTIONFROMPOINT for modifying multiple selections. 4. Add SCI_SETMOVEEXTENDSSELECTION and SCI_CHANGESELECTIONMODE to simplify selection mode manipulation. 5. Improve performance of global replace by reducing cache invalidation overhead. [Feature #1502](https://sourceforge.net/p/scintilla/feature-requests/1502/). 6. Fix regular expression search for "\<" matching beginning of search when not beginning of word and for "\>" not matching line end. [Bug #2157](https://sourceforge.net/p/scintilla/bugs/2157/). 7. Fix regular expression search failure when search for "\<" followed by search for "\>". [Bug #2413](https://sourceforge.net/p/scintilla/bugs/2413/). 8. Fix regular expression assertion (^, $, \b. \B) failures when using SCFIND_CXX11REGEX. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/). 9. Fix regular expression bug in reverse direction where shortened match returned. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/). 10. Avoid character fragments in regular expression search results. [Bug #2405](https://sourceforge.net/p/scintilla/bugs/2405/). 11. With a document that does not have the SC_DOCUMENTOPTION_TEXT_LARGE option set, allocating more than 2G (calling SCI_ALLOCATE or similar) will now fail with SC_STATUS_FAILURE. 12. Protect SCI_REPLACETARGET, SCI_REPLACETARGETMINIMAL, and SCI_REPLACETARGETRE from application changing target in notification handlers. [Bug #2289](https://sourceforge.net/p/scintilla/bugs/2289/). Lexilla 5.3.0 https://www.scintilla.org/lexilla530.zip Released 27 December 2023. 1. Fix calling AddStaticLexerModule by defining as C++ instead of C which matches header. [Bug #2421](https://sourceforge.net/p/scintilla/bugs/2421/). 2. Bash: Fix shift operator << incorrectly recognized as here-doc. [Issue #215](ScintillaOrg/lexilla#215). 3. Bash: Fix termination of '${' with first unquoted '}' instead of nesting. [Issue #216](ScintillaOrg/lexilla#216). 4. HTML: JavaScript double-quoted strings may escape line end with '\'. [Issue #214](ScintillaOrg/lexilla#214). 5. Lua: recognize --- doc comments. Defined by [LDoc](https://github.com/lunarmodules/ldoc). Does not recognize --[[-- doc comments which seem less common. Close #14375
I originally reported this issue on the Notepad++ forum. See the linked issue for explanation.
notepad-plus-plus/notepad-plus-plus#14413
You can use
\
to split long lines of text over multiple lines in the editor for clarity. But the syntax highlighting goes not respect this. The second line after\
should continue as a "string" colour. And ideally the\
itself should be a different colour to make it stand out.The text was updated successfully, but these errors were encountered: