-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML reader with auto_identifiers produces duplicate attributes #8383
Comments
Re-opening so we can add the section divs again, and just fix the id issue. |
I reverted the change. Actually, it appears that the real issue is in the HTML reader. Using [ Div
( "head-2" , [ "section" , "level2" ] , [] )
[ Header
2 ( "head-2" , [] , [] ) [ Str "Head" , Space , Str "2" ]
, Div
( "head-3" , [ "section" , "level3" ] , [] )
[ Header
3 ( "head-3" , [] , [] ) [ Str "Head" , Space , Str "3" ]
... So the problem here is that the HTML reader is adding auto-identifiers to the Header elements that duplicate the identifiers already present in the Divs. That is what needs fixing. This also points to a workaround for your case: use |
With changes to the HTML reader, I now get:
|
OK, those changes led to some other problems, e.g. with the LaTeX writer, so reverting for now. |
What we really need is a pass through the AST at the end of the HTML writer that finds section Divs immediately containing a Header with the same id, and removes the id on the Header. |
(See also pandoc-discuss)
When converting to mediawiki MW headings are prepended with a span
<span id="HEADING-ID"></span>
, evidently to provide an anchor topandoc's original/automatic id so that internal links will still work. However
if there is a
<section>
element1 I frequently end up with an identical idtag on the div resulting from the section element and the automatically
inserted span element, which seems like a bug to me:
It seems that the only fix currently is to go through the MW source after
conversion and manually remove any offending spans.
Footnotes
In my case inserted by pandoc into the HTML now used as source at an
earlier run. ↩
The text was updated successfully, but these errors were encountered: