Giter Site home page Giter Site logo

Comments (7)

mpheath avatar mpheath commented on July 17, 2024 2

@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:
html_escape

If you want the fix any quicker, then you may need to compile Notepad++ yourself with the fix.

Does this commit mean Notepad++ will have another update with the newer editor control?

Expectation is yes as to the routine of Notepad++.

from lexilla.

mpheath avatar mpheath commented on July 17, 2024 1

@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:

lexilla/lexers/LexHTML.cxx

Lines 2175 to 2178 in 6a977a3

} else if (isLineEnd(ch)) {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_STRINGEOL;
}

Single quotes:

lexilla/lexers/LexHTML.cxx

Lines 2188 to 2193 in 6a977a3

} else if (isLineEnd(ch)) {
styler.ColourTo(i - 1, StateToPrint);
if (chPrev != '\\' && (chPrev2 != '\\' || chPrev != '\r' || ch != '\n')) {
state = SCE_HJ_STRINGEOL;
}
}

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

from lexilla.

nyamatongwe avatar nyamatongwe commented on July 17, 2024

See earlier Escape of EOL in JS string does not work.

from lexilla.

ajtruckle avatar ajtruckle commented on July 17, 2024

@nyamatongwe
Sorry, but what is the linked article really saying specific to my case? Thank you.

from lexilla.

nyamatongwe avatar nyamatongwe commented on July 17, 2024

@mpheath

@ajtruckle It is like a note to self as reference.

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.

Still as you mention, related to backslash escape though none in the examples at end of line like your example.

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.

I would expect these 2 code blocks to be the same. Surely one is right and the other is not.

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.

from lexilla.

mpheath avatar mpheath commented on July 17, 2024

@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.

issue214_1.zip

from lexilla.

ajtruckle avatar ajtruckle commented on July 17, 2024

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?

from lexilla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.