简体   繁体   English

SyntaxHighlighter:如何关闭自动关闭标签

[英]SyntaxHighlighter: How to turn off auto closing tags

I use the library syntaxhighlighter.我使用库syntaxhighlighter。 if I give a code within pre tags it will be highlighted based on the file type(js,java).But if there is a opening tag in my given code it will be colsed automatically.如果我在 pre 标签中给出一个代码,它将根据文件类型(js,java)突出显示。但是如果我给定的代码中有一个开始标签,它将被自动折叠。 For example if there is a tag like <code> in my code, it will be automatically closed by </code> .I want to turn off auto closing.例如如果我的代码中有像<code>这样的标签,它会被</code>自动关闭。我想关闭自动关闭。 The link would be http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html该链接将是http://alexgorbatchev.com/SyntaxHighlighter/manual/installation.html

I had the same problem.我有同样的问题。 That's definitely to do with JS, however that was not my scope, so I resolved it this way.这肯定与JS有关,但这不是我的范围,所以我是这样解决的。

Convert < to &lt;转换<&lt; and > to &gt;>&gt; , and store it in your system. ,并将其存储在您的系统中。 Or if you are pulling records from file or DB to show up in browser and highlight the code snippets, you need to write a parser for that making same changes cited above.或者,如果您从文件或数据库中提取记录以显示在浏览器中并突出显示代码片段,则需要编写一个解析器来进行上述相同的更改。

I have also faced this problem in blogspot.我在 blogspot 中也遇到过这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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