Re: Converting transitional to strict

Discussion in 'HTML' started by GTalbot, May 20, 2010.

  1. GTalbot

    GTalbot Guest

    On 16 mai, 09:10, Alfred Molon <> 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/quickref.html#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/quickref.html#enclose-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/
     
    GTalbot, May 20, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Beauregard T. Shagnasty

    Re: Converting transitional to strict

    Beauregard T. Shagnasty, May 16, 2010, in forum: HTML
    Replies:
    3
    Views:
    533
    Jukka K. Korpela
    May 17, 2010
  2. Jukka K. Korpela

    Re: Converting transitional to strict

    Jukka K. Korpela, May 16, 2010, in forum: HTML
    Replies:
    65
    Views:
    2,748
    Neil Gould
    Jun 5, 2010
  3. Adrienne Boswell

    Re: Converting transitional to strict

    Adrienne Boswell, May 16, 2010, in forum: HTML
    Replies:
    1
    Views:
    532
    Jukka K. Korpela
    May 16, 2010
  4. Neredbojias
    Replies:
    1
    Views:
    501
    Jukka K. Korpela
    May 16, 2010
  5. dorayme
    Replies:
    1
    Views:
    488
    Neredbojias
    May 19, 2010
Loading...

Share This Page