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

Can not include -- in comment #40

Open
hax opened this issue Jun 15, 2015 · 4 comments
Open

Can not include -- in comment #40

hax opened this issue Jun 15, 2015 · 4 comments
Labels

Comments

@hax
Copy link
Contributor

hax commented Jun 15, 2015

-- will be transformed to - - (space inserted) and cause syntax error for javascript -- operator.

@hax
Copy link
Contributor Author

hax commented Jun 15, 2015

Normally we should strip comment wrapper (maybe add CDATA wrapper for XHTML/XML serializer).

Solution for compatible for very old browsers:

<script><!--//--><![CDATA[//><!--
        ...
//--><!]]></script>

See https://developer.mozilla.org/en/docs/Writing_JavaScript_for_XHTML

@amio
Copy link

amio commented Jun 23, 2015

描述好像有点不够清楚,我知道这是什么问题了,但是还不清楚未来处理的计划,
这个认为是解析的 bug 还是未来待支持的 feature,或者是一项备忘需要提醒开发者注意?

@hax
Copy link
Contributor Author

hax commented Jun 23, 2015

认为是要解决的bug。解决方式就是去掉script/style的comment wrapper,因为现在浏览器不需要这个。但可以加入compatible模式(如果需要兼容非常老的浏览器),序列化的结果就是上面那个。

@amio
Copy link

amio commented Jun 24, 2015

恩,英文不好 > <

@amio amio added the bug label Jun 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants