google-code-prettify 删除尖括号中的文本
google-code-prettify removes text in angle bracket
我正在使用 google-code-prettify 来语法高亮 CPP 代码。我是这样使用的
<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>
在我得到的结果中,"iostream" 部分不见了。但其余代码的语法高亮显示完美:)
#include
using namespace std;
int main(){
cout << "Hellow world!" << endl;
return 0;
}
我尝试了“<”和“>”之间的其他代码。他们也被删除了。为什么会这样?我如何获得完整代码?
感谢您的帮助
BR
//Asmelash Tse.
这是因为它被解释为 HTML 标签。如果您不希望它们被替换
< with <
> with >
我正在使用 google-code-prettify 来语法高亮 CPP 代码。我是这样使用的
<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>
在我得到的结果中,"iostream" 部分不见了。但其余代码的语法高亮显示完美:)
#include
using namespace std;
int main(){
cout << "Hellow world!" << endl;
return 0;
}
我尝试了“<”和“>”之间的其他代码。他们也被删除了。为什么会这样?我如何获得完整代码?
感谢您的帮助 BR //Asmelash Tse.
这是因为它被解释为 HTML 标签。如果您不希望它们被替换
< with <
> with >