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

Handle <constructor> tags in htmlmixed mode (fixes mozilla bug 1214663) #3596

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion mode/htmlmixed/htmlmixed.js
Expand Up @@ -91,10 +91,11 @@
function html(stream, state) {
var tagName = state.htmlState.tagName;
var tagInfo = tagName && tags[tagName.toLowerCase()];
var isTagInfoArray = Object.prototype.toString.call(tagInfo) === "[object Array]";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also considered using Array.isArray, but IE8 doesn't support that. I took this from the polyfill at https://developer.mozilla.org/ro/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray.


var style = htmlMode.token(stream, state.htmlState), modeSpec;

if (tagInfo && /\btag\b/.test(style) && stream.current() === ">" &&
if (isTagInfoArray && /\btag\b/.test(style) && stream.current() === ">" &&
(modeSpec = findMatchingMode(tagInfo, stream))) {
var mode = CodeMirror.getMode(config, modeSpec);
var endTagA = getTagRegexp(tagName, true), endTag = getTagRegexp(tagName, false);
Expand Down