mmarkdown / mmark

Mmark: a powerful markdown processor in Go geared towards the IETF
https://mmark.miek.nl
Other
480 stars 45 forks source link

Extra content at the end of the document #144

Closed thedevstone closed 2 years ago

thedevstone commented 3 years ago

Execute the command: ./mark.exe mqtt.md mqtt.xml on rfc/7511.md Then xml2rfc.exe --v3 mqtt.xml I got this error: "Extra content at the end of the document"

The errors persist with all the examples

miekg commented 3 years ago

I have no idea what error or non working thing you are trying to describe here

rafael-hashimoto commented 2 years ago

I have the same issue. This markdown: .# Foreword Is been translated to: </name>name>Foreword Then xml2rfc fails with the error:

Error: Unable to parse the XML document: ./document.xml
 document.xml: Line 44: Extra content at the end of the document
miekg commented 2 years ago

[ Quoting @.***> in "Re: [mmarkdown/mmark] Extra content..." ]

I have the same issue. This markdown: .# Foreword Is been translated to: name>Foreword Then xml2rfc fails with the error:

Error: Unable to parse the XML document: ./document.xml document.xml: Line 44: Extra content at the end of the document

I don't understand is that the full document? Because:

% echo '.# Forward' | ./mmark
<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->

<note><name>Forward</name>
rafael-hashimoto commented 2 years ago

open-banking-brasil-financial-api-1_ID3.md

miekg commented 2 years ago

thanks!

miekg commented 2 years ago

Couple of things, this document contains windows line ending (\n\cr) which isn't supported in the parser. I'll see if I can warn abou that - so you are at least aware.

The document also contains chars there aren't ascii, which get automatically translated to \ tags, but the schema doesn't allow these, see https://github.com/rfc-format/draft-iab-xml2rfc-v3-bis/issues/205 which is a bit unfortunate.

Attaching the doc with those changes as that cleanly compiles with xml2rfc open-banking-brasil-financial-api-1_ID3.md

miekg commented 2 years ago

Note: newest mmark converts to unix line ending before parsing, so that should elevate some of the issues you saw.