Notepad++ HTML Tidy
Asked Answered
A

9

49

Is HTML Tidy for Notepad++ broken? None of the commands except Tidy (the first one) work. They don't show any message, even with all text selected. I really need Tidy to work, or is it just a limitation of the newest version of N++, or lack of support?

Also, the custom syntax dialog freezes whenever I select a color from the color dialog. It remains unresponsive until I click one of the bold, italic, or underline checkboxes. Is this a bug? How do I fix it?

Aegir answered 30/4, 2009 at 23:51 Comment(0)
S
32

All of the menu options except the first one rewrite the HTMLTIDY.CFG file, which specifies the formatting rules that HTML Tidy uses. If HTMLTIDY.CFG does not exist, these menu options may not work.

Create a text file and type a simple instruction like:

text-spaces: 2

Save the file as htmltidy.cfg in %ProgramFiles%\Notepad++\plugins\Config\tidy. Restart Notepad++ and all of the options should work.

Spheroidicity answered 18/5, 2009 at 17:56 Comment(1)
Hmm - does not work (at all) here: File is in the right folder, readable, writeable, Notepad++ restarted, but still the error about HTMLTIDY.CFG not being found + the exception afterwards. :|Scary
U
56

Windows 7-10 x64, Notepad++ 5.9.5 Solution:

It has to do with the libTidy.dll not being included in the current distributions.
However, it was available in earlier versions.

Solution is to download the 5.9 zip, then
copy one of the following folders:
ansi\plugins\Config\tidy or Unicode\plugins\Config\tidy
to your current Notepad++\plugins\Config folder

Also, if you install to the c:\Program Files or c:\Program Files (x86) directories, you will need to adjust the permissions on the tidy folder to allow non-administrator access

Unremitting answered 28/10, 2011 at 23:11 Comment(5)
+1 this made it work for me, thx! But i grabbed the files from the Unicode folderGynandromorph
This worked for me with version 6.1.x of Notepad++, but even having the unicode version I had to use the ANSI plugin. The Unicode plugins crashed: https://mcmap.net/q/56460/-notepad-6-1-x-and-htmltidyMilium
For those reading this. This is the answer. I tried a number of other approaches for this question but this is the only one that worked.Justus
Seems to still be working with 6.7 release, thank you !Hatbox
5.9 zip download link is broken, see this: notepad-plus-plus.org/download/v5.9.0.html. Or for other versions here: notepad-plus-plus.org/download/all-versions.htmlAdamson
S
32

All of the menu options except the first one rewrite the HTMLTIDY.CFG file, which specifies the formatting rules that HTML Tidy uses. If HTMLTIDY.CFG does not exist, these menu options may not work.

Create a text file and type a simple instruction like:

text-spaces: 2

Save the file as htmltidy.cfg in %ProgramFiles%\Notepad++\plugins\Config\tidy. Restart Notepad++ and all of the options should work.

Spheroidicity answered 18/5, 2009 at 17:56 Comment(1)
Hmm - does not work (at all) here: File is in the right folder, readable, writeable, Notepad++ restarted, but still the error about HTMLTIDY.CFG not being found + the exception afterwards. :|Scary
W
16

I has this problem in Windows 7... the solution for me was to make sure that the permissions were properly set on HTMLTIDY.CFG

Windhover answered 7/8, 2009 at 17:34 Comment(2)
this one did it for me, but I edited the user permissions for the file %ProgramFiles%\Notepad++\plugins\Config\tidy\TIDYCFG.INI (np++ v5.6.8)Smallish
actually, one hast to adjust the user permissions on both of the files.Smallish
F
14

It's actually the folder (%ProgramFiles%\Notepad++\plugins\Config\tidy) that needs to be writable, not only TIDYCFG.INI. This will allow Notepad++ to write HTMLTIDY.ERR also.

Give "all users" (or whatever it's called on your machine) full control over the folder, and everything should work fine.

Felt answered 26/5, 2010 at 8:29 Comment(0)
M
10

I am running Windows 7 and Notepad++ 5.9. Had the same issue. To resolve:

  1. Give Full Permission for all users to the "C:\Program Files (x86)\Notepad++" folder
  2. Make a new folder called "Config" under "C:\Program Files (x86)\Notepad++\plugins"
  3. Download this file: http://jwaltonmedia.com/tools/tidy.zip. It is a zipped version of the "tidy" folder
  4. Extract the zipped folder to the "Config" folder you created above. It should create a folder called "tidy"

Restart Notepad++ and you should be set.

Misguide answered 3/5, 2011 at 18:50 Comment(4)
thanks, but your link is broken, any chance of a mirror (i hope im not too late :( )Cahn
This didn't work because the zip file cannot be opened. This really shouldn't be required. It just seems as though notepad++ plugins are a dodly to install but impossible to actually make work..Putrid
Giving full permissions to a anything in program files is really unadvisable under any situation.Anglosaxon
@MitchellSkurnik: Right! Not better than another answer stating to run NP++ as administrator. This and other annoyance ring bells and this seems reasonable to not use this plugin at all. I wonder about software from developers who don't even feel a need to apply basic security rules to themselves :-(Apomorphine
W
2

Here's a useful default HTMLTIDY.CFG, one that pretty-prints the HTML for you:

// sample config file for HTML tidy
indent: auto
indent-spaces: 2
wrap: 72
markup: yes
output-xml: no
input-xml: no
show-warnings: yes
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: latin1
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

Taken from: http://sourceforge.net/p/notepad-plus/discussion/482781/thread/c6afffe0

Whinny answered 10/9, 2013 at 14:36 Comment(0)
T
1

Right-click Notepad++
Run as administrator

Thames answered 24/5, 2011 at 1:27 Comment(2)
The problem with this solution is that if you run this on Windows 7 64 bit; it may result in the Open With Notepad++ context menu entry not working (like it did for me). It's better just to modify the permissions on the CFG and INI files; then run as administrator.Midmost
And don't forget to uninstall your firewall just in case!Apomorphine
B
1

Am on v6.6.8 and this plugin worked well:

https://code.google.com/p/npp-tidy2/downloads/list

The ZIP pack has a dll file and a doc folder.

Copy the dll to: %ProgramFiles%\Notepad++\plugins\ and extract the contents of doc to: %ProgramFiles%\Notepad++\plugins\doc\

Restart N++ once you copy.

Usage: Plugins > Tidy2 > ...

By default, Tidy2 generates other HTML tags. You can prevent this by configuring output-xml: no and show-body-only: yes from Plugins > Tidy2 > Edit config...

More on this at: Prevent tidy from adding html tags

Bricole answered 9/4, 2015 at 10:37 Comment(0)
S
0

My guess is that you need to upgrade. I have Notepad++ 5.3.1 (Unicode). The TextFX HTML Tidy plugin works just fine, and the color picker—which used to give me the same problem as you describe—no longer locks up the Styler dialog.

Senescent answered 1/5, 2009 at 2:43 Comment(1)
Still happens in v5.9 on Windows 7Thibault

© 2022 - 2024 — McMap. All rights reserved.