Skip to content

Templating language tags in javascript strings break syntax highlighting #725

@dotandimet

Description

@dotandimet

When trying to implement syntax highlighting for Mojolicious templates (highlight.js pull request, mojo pull request), we found that highlight.js can't handle template tags inside javascript strings.

mojolicious example

This problem also shows up with the ERB syntax (which I used as reference):
ERB example

It doesn't happen with PHP tags, which are handled internally in the xml.js language definition:

PHP example

I suspect this can only be fixed in xml.js, not by modifying an external language definition.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions