Closed alexgarces closed 8 years ago
Hi @alexgarces ,
The weird closing tag is added by browser since the HTML inside hljs
directive element will get parsed by the browser even before AngularJS bootraped.
I think the reason that the same issue doesn't happen on HTML codes is usually you'll have a well-formed HTML code inside hljs
. And in the C++ case, <cv::Point>
is a tag that browser doesn't recognize and there's no closing tag for it.
To deal with most of these issues, use hljs-source
or hljs-include
rather than putting the code inside hljs
directive directly.
<div hljs hljs-language="cpp" hljs-include="'cpp-example'"></div>
<script type="text/ng-template" id="cpp-example">
std::vector<cv::Point> init_positions;
</script>
It worked! Thanks a lot.
Hello,
I have this code snippet inside the directive:
It is rendered as an HTML tag, so at the end of the code it appears a weird closing tag:
</cv::point>
I tried with
<
and>
and they still show as<
and>
. Also when I put just a<
character, it renders like<
, even when there's nohljs-no-escape
set at the directive.It's funny because when working with HTML code I didn't have any problem.