Using Tidy2 for Notepad++

Deadly 提交于 2019-12-06 23:55:21

问题


Something realy strange happend when i try use Tidy2 on my html pages. HTML Entities change from this   to this xA0 (screenshot)

I try different settings in config file but nothing help. Please, some advise


回答1:


You need to set the preserve-entities to 1

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

just add to the end of the config file

preserve-entities: 1

to open the config file go to: Plugins > Tidy2 > Edit config n

source: https://stackoverflow.com/a/6669947/2455951




回答2:


  1. If you use Tidy2, go to: Plugins->Tidy2->Show Config Help

There you will find how to do a configuration. Each key word has its corresponding reasons.

I just try to change the default config to achieve my purpose. I wanted to avoid thisgs as '&#39' when my code was '''. (probably your problem)

At the end the problem was to set.

 quote-marks: no

The reason I found in the file 'Show Config Help' is:

This option specifies if Tidy should output " characters as " as is preferred by some editing environments. The apostrophe character ' is written out as ' since many web browsers don't yet support '.

  1. I'm working with HTML5 and using an encoding in latin1:

2.1 I use Plugins->Tidy2->Edit config1

2.2 I applied it with Plugins->Tidy2->tidy (config 2)

Mi config file is this:

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



回答3:


I encoutered the same problem. After search and experiment, I found that UTF-8 encoding and these settings don't change '&ampnbsp; (the definitive setting is 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:


I believe this has something to do with your encoding settings.

Check if you have char-encoding: raw or output-encoding: raw. In that case you need to change it to whatever encoding you need (utf8 for example).




回答5:


Quick Fix:

Main Menu -> Encoding -> Encode in ANSI

The default config file is OK.




回答6:


If you have encoding utf8 without bom convert it to utf8

my config is: indent: auto indent-spaces: 2 quiet: yes input-encoding: utf8 output-encoding: utf8



来源:https://stackoverflow.com/questions/14865770/using-tidy2-for-notepad

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!