当您开发基于Web的应用程序并且希望允许来自用户的格式丰富的文本时,您必须选择如何允许该输入.已经创建了许多不同的标记语言,因为它可能更难以清理HTML.
各种不同标记语言的优点和缺点如下:
或者换句话说,在选择使用特定标记语言时,您会考虑哪些因素.
我想在使用 nl2br 时忽略以下标签。我有标准的 pre,还有一些特定的 pre 标签。当我这样做是在<br>标签内<pre>粘贴标签。
string = "Here is some text
<pre>
<xml>
<item></item>
<name></name>
</xml>
</pre>
That includes new lines and carriage returns
what can i do to add <p> and <br> tags but not to the text below inside
the <pre> tags </pre>.
<pre class="brush: csharp; title: ;" title="">
public MainPage()
{
// select the culture (de, it, fr, tr are supported)
var ci = new System.Globalization.CultureInfo("tr-TR"); // de-DE etc
// this controls …Run Code Online (Sandbox Code Playgroud)