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

head and body html tags not showed #56

Open
Splact opened this issue Dec 30, 2015 · 1 comment
Open

head and body html tags not showed #56

Splact opened this issue Dec 30, 2015 · 1 comment

Comments

@Splact
Copy link

Splact commented Dec 30, 2015

When I set the language as HTML, any "html", "head" and "body" tags are not showed when parsed. Any tips?
This pen is just an example of the problem http://codepen.io/anon/pen/WroLBM

@pc035860
Copy link
Owner

Hi, sorry for the late response.

You can't use pure hljs directive to highlight HTML code with special tags like html, head, body, since the content of hljs will be parsed by browser before AngularJS even get bootstrapped.

Use either hljs-source or hljs-include to ensure the code doesn't get parsed by browser.

<div hljs hljs-include="'html-source-code'"></div>

<script id="html-source-code" type="text/ng-template">
<head><title>fooo</title></head><h1 haha="noob">LOL</h1>
</script>

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