How to configure Tidy html output Options
Arjandb
Posted: Thursday, September 13, 2007 11:10:00 AM
Rank: Devotee

Joined: 8/31/2007
Posts: 50
Location: Utrecht NL
How to configure Tidy html output in Umbraco?

I know how to edit a tidy configuration file, but editing umbraco\config\tidy\ConfigTidy.txt does'nt seem to have any effect.

I edited ConfigTidy.txt as below, but it does'nt work, doctype is still added and output is not XHTML:

doctype: omit
indent-spaces: 4
wrap: 0
char-encoding: utf8
input-encoding: utf8
output-encoding: utf8
alt-text: Foto
indent: auto
output-xhtml: yes
bare: yes
clean: yes
logical-emphasis: yes
drop-proprietary-attributes: yes
drop-font-tags: yes
wrap-attributes: yes
tidy-mark: no
show-body-only: yes
cpalm
Posted: Thursday, September 13, 2007 11:16:09 AM

Rank: Aficionado

Joined: 7/19/2006
Posts: 164
What version of umbraco are you running?
Are you sure tidy is getting called at all?
Have you tried to restart the website (save web.config)

CPalm, www.cpalm.dk
Arjandb
Posted: Thursday, September 13, 2007 2:07:52 PM
Rank: Devotee

Joined: 8/31/2007
Posts: 50
Location: Utrecht NL
Umbraco version: 3.0.2

Tidy output (with above config settings):

Code:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy for Windows (vers 1st May 2002), see www.w3.org">
<title></title>
</head>
<body>
<p>test 123<br>
<strong>bold</strong></p>
</body>
</html>


It seems to be an older problem:
http://forum.umbraco.org/4846#post-4846
cpalm
Posted: Thursday, September 13, 2007 2:20:14 PM

Rank: Aficionado

Joined: 7/19/2006
Posts: 164
When editing the tidy config file, you should restart the website. Maybe even restart the server. If the server is a development server please try to restart it.

CPalm, www.cpalm.dk
Arjandb
Posted: Thursday, September 13, 2007 7:05:46 PM
Rank: Devotee

Joined: 8/31/2007
Posts: 50
Location: Utrecht NL
Even after a full server restart... same output.

Is the config file in the right location?
Is the name of the confif file as it sould be?

Thank you.
cpalm
Posted: Friday, September 14, 2007 9:11:43 AM

Rank: Aficionado

Joined: 7/19/2006
Posts: 164
After opening Reflector and digging into the code I found:
Code:
   
if (LiveEditing)
{
   str3 = HttpContext.Current.Server.MapPath(GlobalSettings.Path + "/../config/")+ "tidy_liveediting.cfg";
    }
    else
    {
        str3 = HttpContext.Current.Server.MapPath(GlobalSettings.Path + "/../config/") + "tidy.cfg";
    }


It uses the /config/tidy.cfg file have you tried this? if it does not exist in your solution just create the file.
After you have tidy'ed a page try also to look at the logs for any errors


CPalm, www.cpalm.dk
Arjandb
Posted: Friday, September 14, 2007 11:33:49 AM
Rank: Devotee

Joined: 8/31/2007
Posts: 50
Location: Utrecht NL
Yes, that's the solution. Thanks!

I think the Umbraco release files should be updated, removing:

/umbraco/config/tidy/ConfigTidy.txt

and adding:
/config/tidy.cfg

...with at least a "doctype: omit" and "output-xhtml: yes" setting.
Otherwise Tidy is adding an extra page header in the middle of a page, and converts xhtml back to html2 by default as soon as TidyEditorContent is set to True.
Arjandb
Posted: Friday, September 14, 2007 11:36:37 AM
Rank: Devotee

Joined: 8/31/2007
Posts: 50
Location: Utrecht NL
Forgot to mention "show-body-only: yes" as a Tidy setting required to prevent adding a page header in the middle of the page.
Jasko
Posted: Thursday, July 03, 2008 5:38:51 PM
Rank: Devotee

Joined: 12/11/2006
Posts: 47
Hi

I am currently trying to change the char-encoding and output-encoding to latin1 instead of ASCII.

But I am a bit confused on how to do this - Should it be done in the ConfigTidy.txt or should one create a tidy.cfg file?

I am currently running an 3.0.5 installation and I want to be able to output the danish characters æ,ø and å making sure that they are not being converted into &aelig;, &oslash; and &aring;

My ConfigTidy.txt looks like this. I have added char-encoding and output-encdoing at the bottom. I have also created a tidy.cfg file, which contains the same.

doctype: omit
alt-text:
tidy-mark: no
word-2000: yes
clean: yes
drop-font-tags: yes
indent: no
indent-spaces: 2
wrap: 72
markup: yes
output-xml: yes
char-encoding: latin1
output-encoding: latin1

But I don't seem to have any luck getting it to work. - I have placed the tidy.cfg file in the config folder.

Can anyone explain to me what I have to do to get this working? :)

/Jan
Jasko
Posted: Thursday, July 03, 2008 9:38:19 PM
Rank: Devotee

Joined: 12/11/2006
Posts: 47
Hmm, made a mistake when typing in the version of Umbraco, which I am currently running. It is not 3.0.5 but 3.0.3

/Jan
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.