angular-highlightjs
angular-highlightjs copied to clipboard
head and body html tags not showed
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
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>