简体   繁体   中英

google-code-prettify removes text in angle bracket

I am using google-code-prettify to syntax-highlight CPP code. I used it as follows.

 <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?lang=cpp"></script> <pre class="prettyprint"><code> #include <iostream> using namespace std; int main(){ cout << "Hellow world!" << endl; return 0; } </code> </pre> 

In the result I get, the "iostream" part is gone. But the rest of the code is syntax-highlighted perfectly :)

 #include using namespace std; int main(){ cout << "Hellow world!" << endl; return 0; } 


I tried other codes in between "<" and ">". They were removed too. Why is this so? How do I get the whole code?

Thanks for your help BR //Asmelash Tse.

This is because it gets interpreted as a HTML tag. If you want them not to be replace

< with &lt;
> with &gt;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM