bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: texi2html output validity


From: Yuri Khan
Subject: Re: texi2html output validity
Date: Tue, 23 Dec 2014 21:29:07 +0700

On Tue, Dec 23, 2014 at 4:37 PM, Ivan Shmakov <address@hidden> wrote:
>  >>> <a 
> href="79/lily-83620d4b.ly"><p>&lsquo;<tt>accidental-ancient.ly</tt>&rsquo;
>  >>> </a>    <p>
>  >>>  <a href="79/lily-83620d4b.ly">
>  >>>   <img align="middle"
>  >>>        border="0"
>  >>>        src="79/lily-83620d4b.png"
>  >>>        alt="[image of music]">
>  >>>  </a>
>  >>> </p></p>
>
>  >> In this snippet, I count 2 instances of improper tag nesting,
>
>         I count just a single one, but yes, that second </p> surely
>         invalidates the fragment.

<a><p></a> is improper* nesting in my book. All paired tags SHOULD**
be explicitly closed.

* note I did not say “invalid”
** as in RFC2119

>         I hereby suggest that:
>
>         • the <code /> element is /always/ used instead of <tt />;

Cursory reading of HTML.pm seems to indicate that <tt> is currently***
used for @key, @t, @verb, and some kinds of tables possibly related to
@example, @smallexample, @lisp and @smalllisp.

*** 5.2.0.dfsg.1-2 as packaged in Ubuntu 14.04

@key should be rendered as <kbd>, possibly with an additional class.
Yes, even when inside @kbd — HTML allows and encourages nesting <kbd>.

@t is a non-semantic command in Texinfo and should probably be
discouraged the same way <tt> has been discouraged in HTML since at
least 1997. It probably should become a <span class="t"> styled with
.t { font-family: monospace }.

@verb is syntax sugar for escaping characters which have special
meaning in Texinfo, and has a non-semantic side effect of fixed-width
rendering. It probably should become a <span class="verb">.

Code examples are a good match for <code>.

>         • <img align="ALIGN" border="0" … /> is replaced with
>           <img style="text-align: ALIGN; border: 0;" … />;

No. { border: 0 } should just be specified in CSS for all img, while
alignment should be handled by classes.

>         • unless there’s a really good reason to nest <p /> inside an
>           <a />, – do it in reverse: <p ><a …></a>; for one thing, this
>           makes it possible to simply omit any </p>s on output.

+1 for nesting <a> within <p>. -1 against omitting closing tags.


Note also that <tt> and <a>/<p> nesting order are just the tip of the
iceberg. The wider problem is that the Texinfo HTML generator
generally assumes HTML ≈3.2 even though it declares 4.01 Transitional:

* <a name> should be dropped in favor of placing an id on the parent element;
* alignment should be handled by classes;
* <table border=… cellpadding=… cellspacing=…>, <tr valign=…>, <td
align=…> should be replaced with CSS;
* tables should be generally avoided unless actually representing tabular data;
* table cells containing only non-breaking spaces indicate some
problem that should be solved, not worked around;
* a non-breaking space immediately adjacent to a normal space is nonsensical;
* more than one contiguous non-breaking space is a kludge;
* <br> are fit for poetry and postal addresses and almost nothing else;
* <font size=…> should be replaced with CSS;
* OUTPUT_ENCODING_NAME should be deprecated in favor of UTF-8;
* the encoding declaration <meta> should be the first thing in <head>;
* I might have missed something.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]