Embedded JavaScript grammar can break the colorization · Issue #85 · textmate/html.tmbundle · GitHub
Skip to content

Embedded JavaScript grammar can break the colorization #85

Description

@aeschli

The following code doesn't highlight correctly in VSCode after //</script>. The problem is that the embedded JavaScript grammar consumes the full //</script> and the sourrounding html rule doesn't end. The grammar is stuck in js.

<!DOCTYPE html>
<html>
<head>
    <script>
        //</script>
</head>
<body>

</body>
</html>

There are many similar issues when the JS code is not complete and the JavaScript grammar is in the middle of some rule.

IMO the best thing would be to not include the full blown JavaScript grammar but embed a (simplified) variant that is aware of the </script> tag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions