On 16 mai, 09:10, Alfred Molon <alfred_mo...@yahoo.com> wrote:
> I was trying to convert the pages from my site from transitional to
> strict and ran into problems.
[snipped]
> I was wondering if perhaps some
> translators/converters exist, which convert transitional code into
> strict code.
HTML Tidy would do that but it's not a perfect tool to convert page
written according to a transitional DTD into one written according to
strict DTD.
There are several HTML Tidy options which do that:
clean:
This option specifies if Tidy should strip out surplus presentational
tags and attributes replacing them by style rules and structural
markup as appropriate. It works well on the HTML saved by Microsoft
Office products.
http://tidy.sourceforge.net/docs/quickref.html#clean
drop-font-tags:
This option specifies if Tidy should discard <FONT> and <CENTER> tags
without creating the corresponding style rules. This option can be set
independently of the clean option.
http://tidy.sourceforge.net/docs/qui...drop-font-tags
enclose-block-text:
This option specifies if Tidy should insert a <P> element to enclose
any text it finds in any element that allows mixed content for HTML
transitional but not HTML strict.
http://tidy.sourceforge.net/docs/qui...ose-block-text
Best is still to learn how to fix HTML errors starting from the W3C
markup validator and learn how to avoid writing HTML errors in the
first place.
I use Bluefish 1.0.7 with HTML Tidy on Linux; I use PSPad 4.5.4 with
HTML Tidy on Windows.
These are the arguments I use with Bluefish:
tidy --char-encoding utf8 --clean yes --doctype strict --drop-font-
tags yes --drop-proprietary-attributes yes --enclose-block-text yes --
enclose-text yes -indent --logical-emphasis yes --output-html yes --
replace-color yes --show-warnings no --wrap 76 --write-back yes >'%f'
2>/dev/null
regards, Gérard
--
Internet Explorer 7 bugs: 185 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
Internet Explorer 8 bugs: 60 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/