javascript back-tick quoted strings bad color



  • Using Notepad++ v6.8.8 and v6.9 on Windows

    Steps to reproduce:

    1. Set syntax to “Javascript”
    2. Write a template string: `test${1234}test`

    Actual behavior:
    The whole string turns white and can’t be read on white background.

    Expected behavior:
    The string should be formatted using a color more appropriate for strings.
    There should be an option in the “Stiles”-Dialog for changing the color of these template strings.
    The expression parts should be highlighted in another color than the template string.

    I’ve also read, that template strings in script tags should be implemented for HTML and PHP highlighting, but there they don’t actually have a special highlighting.

    btw, the submit button for this board isn’t visible when the with of the browser window is to small (right screen half)



  • Edit: when putting the cursor on a new line, the template string will be displayed with gray background and white color. Somehow this seems like someone has accidentially switched forground and background color?



  • Hello @Karl-Kraus

    isn’t it Style Configurator->Java script->STRINGRAW?

    Cheers
    Claudia



  • Do you mean there’s supposed to be an entry STRINGRAW in Options > Styles… > JavaScript? Well, there isn’t for me.



  • Hello @CoDEmanX47,

    in npp 6.9 I do have it as seen here.

    Cheers
    Claudia



  • @Claudia-Frank

    I’m sorry, but i also dont got this Styles-Template (npp 6.9).

    Screenshot: http://imgur.com/GVezksS

    Maybe you installed some Plugins/additional Stylesheets?

    KR, Robert



  • Hello Robert,

    when npp gets updated using the auto updater then langs, styles and config.xml don’t get updated
    to avoid that those configuration files, which can be/are configured by users gets overwritten.
    So I assume you don’t really have the latest langs und styles.xml.
    To test this you can temporarily rename the langs.xml and styles.xml to, let’s say langs.xml.old
    (stylers.xml.old) and rename langs.model.xml and stylers.model.xml to langs.xml (stylers.xml).
    The files are located in the npp install directory or when you have an %APPDATA% configuration,
    then under %APPDATA%\notepad++.

    Cheers
    Claudia



  • I renamed %appdata%\Notepad++\stylers.xml as suggested and Notepad++ created a new one with the following additional entry for JavaScript:

    <WordsStyle name="STRINGRAW" styleID="20" fgColor="FFFFFF" bgColor="808080" fontName="" fontStyle="0" fontSize="" />
    

    I can adjust the fore- and background color just fine in the style configuration inside Notepad++. Thanks!

    One more thing I noticed: There’s JavaScript (embedded)*, and there’s JavaScript. The former does not have the STRINGRAW style and is also lacking a few others that are available in the javascript.js style. The “embedded” label is cut off in the style configuration dialog, because the list box is too narrow.

    * actually “embbeded”, with a typo



  • Hello @CoDEmanX47,

    afaik embedded ;-) javascript is the one which gets recognized when used in html file.
    So, I’m not an expert in java script, I assume that this “clone” doesn’t have that functionality
    as it isn’t used/allowed/expected/?? in html file.

    Maybe someone else with a deeper understanding of embedded java script knows more about it?

    Cheers
    Claudia



  • I removed the stulers and lang.xml. Notepad recreates them indeed. The files are bit shorter but this did not fix the formatting anyhow.



  • This is still an issue in v7.7.1

    screenshot showing unreadable highlighting


Log in to reply