Highlight template literals

  • Hello,

    Hope you can help me with this. I created a simple plugin to highlight TypeScript syntax (also useful for ES6)

    woltlab.com/pluginstore/file/2591/


    Currently, I'm treating the template strings (strings inside backticks ` ) as normal quotes but I'd like to treat them differently especially when there are variables or html tags inside:

    Built-in JS highlighter

    TS highlighter:


    WebStorm highlighter:


    The class looks like this, I think I have to store the template string in some temporal variable and evaluate it with RegEx but I'm not sure how to do it nor the regular expressions I need to use.

    My styles and plugins in the Plugin-Store.

    Spoiler anzeigen

    — ¡Carajo! —gritó

    Amaranta, que empezaba a meter la ropa en el baúl, creyó que la había picado un alacrán.

    — ¿Dónde está? —preguntó alarmada.

    —¿Qué?

    — ¡El animal!

    Úrsula se puso un dedo en el corazón.

    — Aquí —dijo.

    ♪Quiero robarle los minutos a las horas pa' que mis padres nunca se me pongan viejos...♫

    Einmal editiert, zuletzt von Caribe_Soy (11. Mai 2017 um 13:19)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!