-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Rendering from HTML to Djot gives unexpected results #35
Comments
Note that the conversion via pandoc to HTML is fine: <section id="top" id="top">
<h1>Djot test document</h1> The problem is that in converting this back from HTML, pandoc introduces an automatic identifier on the heading. (Pandoc AST output:)
I'm inclined to call this a bug in pandoc; pandoc should avoid adding these identifiers when the heading is the first element in a section that already has an id. You can work around this though by using |
Ah, ok that makes sense. What about the issue where the attribute second is gone from the html that I render via Pandoc, could that be a bug too?
|
On |
That would be ok. I wonder how we can avoid conflicts between Djot and Pandoc for the future?
Not to offend anyone, but I really see Djot as a format for non programmers too, and therefor I got a little worried when a quite simple document as mine changed that much, when I had to use Pandoc to get Djot syntax from HTML.
Wonder if Djot could take over more of the conversion so Pandoc would convert based upon what Djot can do, so we perhaps can avoid conflicts in different ASTS either in Djot or Pandoc.
|
Ah ok that sounds like a bug in Pandoc to mee as well. I have seen Pandoc get this right when using Markdown as source. Would you like me to make an issue over there about this?
|
When converting a document from Djot to HTML and later back to Djot again there can be some interesting side effects, like explicit heading identifiers being broken since the HTML render both makes id's for the section-tag and the heading-tag.
Here is how to reproduce:
Save this file as Djot:
Now convert this document to HTML by running Djot via Pandoc. This is important since we want a stand-alone HTML-version of the document. I did:
djot -f djot hello.dj.txt -t pandoc | pandoc -f json -t html -s -o hello.html
Pandoc will give a warning since there is no title specified when we converted this.
Now try to convert the document from HTML back to Djot again by doing:
pandoc hello.html -f html -t json | djot -f pandoc -t djot > hello2.dj.txt
This shows the following document
The following changed during the convertion:
If I on the other hand convert the original document via Djot to HTML the link to second will work, but then I do not get the stand-alone HTML-version as Pandoc can produce.
The text was updated successfully, but these errors were encountered: