Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htmlmixed mode script types problem #1271

Closed
redmunds opened this issue Feb 21, 2013 · 0 comments
Closed

htmlmixed mode script types problem #1271

redmunds opened this issue Feb 21, 2013 · 0 comments

Comments

@redmunds
Copy link
Contributor

This bug is the same as Brackets bug: adobe/brackets#2906 . Note that this bug also existed with original implementation of mustache type (it was not introduced with recent changes).

CodeMirror has the same bug in the htmlmixed demo page: http://codemirror.net/mode/htmlmixed/index.html

Put this markup in the htmlmixed mode demo page:

    <script id="myTemplate" type="text/x-mustache-template">
        <h1>{{firstName}} {{lastName}}</h1>
        <p>Blog URL: <a href="{{blogURL}}">{{blogURL}}</a></p>
    </script>

The first line of markup is colored correctly, but the second line is not.

The scriptType (for both the demo page and Brackets) is defined as follows:

{matches: /\/x-handlebars-template|\/x-mustache/i, mode: null}

If I change the mode from null to "htmlmixed", the coloring for that block is fixed, but subsequent script blocks are messed up.

I think it's because "htmlmixed" mode inside the <script> block doesn't handle the closing script tag (i.e. </script>) as it is handled in the the script() function in htmlmixed.js.

What do you think is he best way to fix this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants