整洁的标签后没有换行符 [英] No linebreak after tags in tidy
问题描述
我有以下输入:
<p>嗨<span>你</span></p>
我想将其视为 XML.
我使用以下选项在 cmd 行上运行 Tidy:
input-xml: 是输出-xml:是缩进:没有
我的输出是这样的:
嗨<span>你</span></p>
但是,我希望不要漂亮地打印 xml.我希望它尊重所有空白,而不是添加换行符.我似乎无法找到一种没有漂亮打印的输出 XML 的方法.有人知道怎么做吗?
我遇到了同样的问题.我找到了一个可能的解决方案并将其发布在 PHP Tidy 删除空格和插入换行符
总结就是:在你要修复的xml周围放
-tags,使用output-html = true,然后去掉-标签和换行符.
HI, I have the following input:
<p>Hi <span>you</span></p>
I'd like to treat this as XML.
I run Tidy on the cmd-line with the following options:
input-xml: yes output-xml: yes indent: no
My output is this:
<p>Hi <span>you</span></p>
However I'd like tidy to not pretty-print the xml. I'd like it to respect all white space, and not add that line break. I can't seem to find a way to output XML without pretty-printing. Anyone know how to do this?
解决方案I had the same problem. I found a possible solution and posted it at PHP Tidy removes whitespace and inserts newlines
The summary is: put
<pre>
-tags around the xml you want to repair, use output-html = true, then remove the<pre>
-tags and newlines.这篇关于整洁的标签后没有换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!