On 2013-12-27 12:23, Bastien wrote:
Rustom Mody <rustompm...@gmail.com> writes:
When the html-doctype is set to html5 the generator still generates
name attributes in links which is not correct html5
http://dev.w3.org/html5/markup/a.html#a-constraints
Can you give an example of what it does and what it should do?
Rustom is referring to the fact that the `name' attribute has been
marked obsolete in HTML5.
While the html5 spec suggests using the id attribute on a surrounding
container rather than a named anchor, the id attribute is still valid
on an anchor in html5.
In fact, ox-html already has support for handling the issue:
(defcustom org-html-allow-name-attribute-in-anchors t
"When nil, do not set \"name\" attribute in anchors.
By default, anchors are formatted with both \"id\" and \"name\"
attributes, when appropriate."
:group 'org-export-html
:version "24.4"
:package-version '(Org . "8.0")
:type 'boolean)
Rustom-
For now, just set this variable to nil and the anchors will be
exported with an id and no name attribute. If `org-export-allow-BIND'
is true, putting the following in the head of the document will work:
#+BIND: org-html-allow-name-attribute-in-anchors nil
Bastien-
I will look at making this the default when i have time if the doctype
is html5 (`org-html-html5-p' is true), but it requires some work to
get the info structure passed down to `org-html--anchor'.