【问题标题】:Using Tidy2 for Notepad++使用 Tidy2 记事本++
【发布时间】:2013-01-29 17:17:15
【问题描述】:

当我尝试在我的 html 页面上使用 Tidy2 时,确实发生了一些奇怪的事情。 HTML 实体从这个   更改为这个 xA0 (screenshot)

我在配置文件中尝试了不同的设置,但没有任何帮助。请大家多多指教

【问题讨论】:

  • 死Dropbox链接:/

标签: notepad++ tidy


【解决方案1】:

您需要将保留实体设置为 1

http://tidy.sourceforge.net/docs/quickref.html#preserve-entities

只需添加到配置文件的末尾

preserve-entities: 1

要打开配置文件,请转到: 插件 > Tidy2 > 编辑配置 n

来源:https://stackoverflow.com/a/6669947/2455951

【讨论】:

    【解决方案2】:
    1. 如果您使用 Tidy2,请转到:Plugins->Tidy2->Show Config Help

    在那里你会发现如何进行配置。每个关键词都有对应的原因。

    我只是尝试更改默认配置以实现我的目的。我想避免thisgs ''' 当我的代码是'''。 (可能是你的问题)

    最后的问题是设置。

     quote-marks: no
    

    我在“显示配置帮助”文件中找到的原因是:

    此选项指定 Tidy 是否应该按照某些编辑环境的偏好输出“characters as”。撇号字符 ' 写成 ' 因为许多网络浏览器还不支持 '。

    1. 我正在使用 HTML5 并在 latin1 中使用编码:

    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
    

    【讨论】:

    • 截至 2017 年 5 月 4 日,帮助指向 404 页面。包维护者需要更新参考。
    【解决方案3】:

    我遇到了同样的问题。经过搜索和实验,我发现UTF-8编码和这些设置并没有改变'&ampnbsp;(最终的设置是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
    

    【讨论】:

      【解决方案4】:

      我相信这与您的编码设置有关。

      检查您是否有char-encoding: rawoutput-encoding: raw。在这种情况下,您需要将其更改为您需要的任何编码(例如 utf8)。

      【讨论】:

      • 两者都存在,都是utf8设置的,一点帮助都没有
      【解决方案5】:

      快速修复:

      主菜单 -> 编码 -> ANSI 编码

      默认配置文件OK。

      【讨论】:

        【解决方案6】:

        如果你有编码 utf8 而没有 bom 将其转换为 utf8

        我的配置是: 缩进:自动 缩进空格:2 安静:是的 输入编码:utf8 输出编码:utf8

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2016-05-21
          • 2010-11-06
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多