#252 <tt> is obsolete in HTML5

repository
closed-fixed
nobody
None
5
2015-03-11
2014-03-24
Jean Lauliac
No

The inline litteral markup in reStructuredText seems to generate <tt> HTML tags. This has been deprecated. A decent alternative would probably to use the <code> tag.

How do you think this should be addressed? I can make the change to use <code> if approved.

Discussion

  • Günter Milde
    Günter Milde
    2015-02-16

    • status: open --> pending-works-for-me
     
  • Günter Milde
    Günter Milde
    2015-02-16

    Although its use is discouraged, <tt> is not deprecated in HTML 4.1 (which is the HTML variant Docutils produces), see http://www.w3.org/TR/html4/present/graphics.html#h-15.2

    As reST distinguishes between "inline literal" and "code" roles, the "code" tag does not seem to be the best match for inline literal:

    The HTML <code> Element represents a fragment of computer code.

    Many inline literals do not.

    In my view, "tt" is still the correct HTML tag for "inline literal". Styling is done with CSS, class-values specify the semantic, using "tt" instead of "span" ensures "graceful degradation" (i.e. correct rendering in browsers without CSS support).

     
  • Günter Milde
    Günter Milde
    2015-02-26

    • status: pending-works-for-me --> closed-invalid
     
  • Günter Milde
    Günter Milde
    2015-03-11

    • status: closed-invalid --> closed-fixed
     
  • Günter Milde
    Günter Milde
    2015-03-11

    The new html-base writer which generates HTML5 replaces the "tt" tag with a CSS-styled "span". This behaviour is also inherited by the xhtml11 writer. (Both writers produce "polyglott" html/xhtml output.)

    The html4css1 writer keeps the previous behaviour, producing valid XHTML1.1 (transitional) with some formatting in HTML to keep browsers with limited CSS support happy.