tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

name is not an attribute of div #143

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

In pqNotes.py, there is the following line:

fnt_rep = QString(u"<div class='footnote' id='FN_%1' name='FN_%2'>\u2029\u2029<span class='fnlabel'><a href='#FA_%3'>[%4]</a></span>")

name is not an attribute, at least in xhtml 1.0 strict.

tallforasmurf commented 11 years ago

I was going to say, "straight out of guiguts" but on checking, it isn't, quite. From Guiguts::HTMLconvert.pm, "<div class=\"footnote\"><p><a name=\"$::htmllabels{fnlabel}" So they put the name property on the anchor (or, I would think better, the <p>), not the div. Didn't know div's couldn't have name properties. Strange. Can they have id's? Anyway, will fix.

bibimbop commented 11 years ago

Yes, div, as well as most tags, can have an id. Once the name was removed, the html file validated.

tallforasmurf commented 11 years ago

Oh, I am so confused ;-) Yes, as you say, the name= attribute of a is deprecated but allowed in XHTML1.0 (http://www.w3.org/TR/xhtml1/#C_8) and indeed for maximum backward compatibility both name and id should be used (http://www.w3.org/TR/xhtml1/#h-4.10). So I'm putting it back with a commit coming in about 10 minutes.

Also as you say, the name property is removed in XHTML1.1 (http://www.w3.org/TR/xhtml11/changes.html#a_changes) which means that at some future time I will have to add some kind of configuration switch specifying which type of markup to generate. Or perhaps search the document for the doctype specification on the fly? At any rate, for the time being XHTML1.1 is not supported.

bibimbop commented 11 years ago

I think the html conversion should have a drop down menu with the desired targets: html 4, xhtml 1.0, xhtml 1.1, html 5 and xhtml 5 (eventually). Currently the vast majority of DP books are html 4 and xhtml 1.0. That would also allow PPQT to add the proper html headers.

But for now, having a/name back is what matters.