Mark as HTML as an inspection comment


Resharper has this nifty feature of being able to mark a JavaScript string as containing HTML. This enhances the editing experience considerably. However, the "Mark as HTML" state is not remembered when the file is closed. I would like to suggest that an "inspection comment" be added so the string can be tagged permanently as HTML.


    // ReSharper Mark as HTML
    const template = `
        <div style="margin: 1em 0 0 1em">
        <button class="pure-button">Export CSV</button>

Comment actions Permalink
Official comment

Hello Mike,

You may use "//language=html" comment to mark a string as HTML code.

And by the way, please install R# 2016.3 EAP, since the issue about removing "Mark as HTML" range after closing a file is not reproduced there.


Comment actions Permalink

Thanks for the tip. The comment works great.

As to the not remembering issue, I'm using Typescript 2.0 so maybe that influences things

I've noticed that if I close the file and reopen it, the setting is remembered. If I close Visual Studio and reopen, the Mark as Html setting is not remembered, but not in all instances (weird).

I appreciate the early access but I've found it too disruptive


Please sign in to leave a comment.