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
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
- 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
''' 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 '.
- 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
I encoutered the same problem. After search and experiment, I found that UTF-8 encoding and these settings don't change '  (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
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).
Quick Fix:
Main Menu -> Encoding -> Encode in ANSI
The default config file is OK.
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