Skip to content

[BUG] Incorrect syntax highlighting issue using HTML language for JavaScript Template literals use HTML TAG #15368

@chenkh-tcte

Description

@chenkh-tcte

Is there an existing issue for this?

  • I have searched the existing issues

Description of the Issue

This example is syntax highlighted incorrectly in HTML language but works in JavaScript language.
JavaScript Template literals use HTML TAG

<script>
	var variant = `<p>Text</p>`;
	console.log(variant);
	for (var i = 0; i < 10; i++) {}
</script>

Notepad++ -> Language -> HTML

image

Notepad++ -> Language -> JavaScript

image

Steps To Reproduce

  1. Copy the example to Notepad++.
  2. Set the syntax language to HTML.
  3. Look at the incorrect syntax highlighting.
  4. Set the syntax language to JavaScript.
  5. Look at the correct syntax highlighting.

Current Behavior

The syntax highlighting is incorrect using HTML language for JavaScript Template literals use HTML TAG.

Expected Behavior

The syntax highlighting is correct, as shown in the JavaScript language example screenshot.

Debug Information

Notepad++ v8.6.8   (64-bit)
Build time : Jun  4 2024 - 00:30:00
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\Program Files\Notepad++\change.log" 
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
Periodic Backup : ON
OS Name : Windows 11 Pro for Workstations (64-bit)
OS Version : 23H2
OS Build : 22631.3737
Current ANSI codepage : 950
Plugins : 
    ComparePlugin (2.0.2)
    HexEditor (0.9.12)
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    NppPluginOpenHost (1.1)

Anything else?

JavaScript reference template literals (Template strings)
W3schools template strings example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions