【发布时间】:2013-01-29 17:17:15
【问题描述】:
当我尝试在我的 html 页面上使用 Tidy2 时,确实发生了一些奇怪的事情。
HTML 实体从这个   更改为这个 xA0 (screenshot)
我在配置文件中尝试了不同的设置,但没有任何帮助。请大家多多指教
【问题讨论】:
-
死Dropbox链接:/
当我尝试在我的 html 页面上使用 Tidy2 时,确实发生了一些奇怪的事情。
HTML 实体从这个   更改为这个 xA0 (screenshot)
我在配置文件中尝试了不同的设置,但没有任何帮助。请大家多多指教
【问题讨论】:
您需要将保留实体设置为 1
http://tidy.sourceforge.net/docs/quickref.html#preserve-entities
只需添加到配置文件的末尾
preserve-entities: 1
要打开配置文件,请转到: 插件 > Tidy2 > 编辑配置 n
【讨论】:
在那里你会发现如何进行配置。每个关键词都有对应的原因。
我只是尝试更改默认配置以实现我的目的。我想避免thisgs
''' 当我的代码是'''。 (可能是你的问题)
最后的问题是设置。
quote-marks: no
我在“显示配置帮助”文件中找到的原因是:
此选项指定 Tidy 是否应该按照某些编辑环境的偏好输出“characters as”。撇号字符 ' 写成 ' 因为许多网络浏览器还不支持 '。
2.1 我用Plugins->Tidy2->Edit config1
2.2 我用 Plugins->Tidy2->tidy (config 2) 应用它
我的配置文件是这样的:
indent: auto
indent-spaces: 2
wrap: 132
markup: yes
output-html: yes
numeric-entities: yes
quote-marks: no
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
new-inline-tags: cfif, cfelse, math, mroot,
mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
munder, mover, mmultiscripts, msup, msub, mtext,
mprescripts, mtable, mtr, mtd, mth
new-blocklevel-tags: cfoutput, cfquery
new-empty-tags: cfelse
char-encoding: latin1
output-encoding: no
input-encoding: no
【讨论】:
我遇到了同样的问题。经过搜索和实验,我发现UTF-8编码和这些设置并没有改变' (最终的设置是numeric-entities:no):
indent: auto
indent-spaces: 2
wrap: 132
markup: yes
output-html: yes
numeric-entities: no
quote-marks: no
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
new-inline-tags: cfif, cfelse, math, mroot,
mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
munder, mover, mmultiscripts, msup, msub, mtext,
mprescripts, mtable, mtr, mtd, mth
new-blocklevel-tags: cfoutput, cfquery
new-empty-tags: cfelse
【讨论】:
我相信这与您的编码设置有关。
检查您是否有char-encoding: raw 或output-encoding: raw。在这种情况下,您需要将其更改为您需要的任何编码(例如 utf8)。
【讨论】:
快速修复:
主菜单 -> 编码 -> ANSI 编码
默认配置文件OK。
【讨论】:
如果你有编码 utf8 而没有 bom 将其转换为 utf8
我的配置是: 缩进:自动 缩进空格:2 安静:是的 输入编码:utf8 输出编码:utf8
【讨论】: