mmarkdown / mmark

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

xml:refcontent is stripped from the resulting xml file #142

Closed tmarkovski closed 3 years ago

tmarkovski commented 3 years ago

When using XML in the markdown, when <reference> attribute contains <refcontent> it is stripped in the resulting XML file.

For example, in my markdown file I added the following:

<reference anchor="ECMA-262" target="https://www.ecma-international.org/ecma-262/10.0/index.html">
  <front>
    <title>ECMAScript 2019 Language Specification</title>
    <author>
      <organization>ECMA International</organization>
    </author>
    <date year="2019" month="June"/>
  </front>
  <refcontent>Standard ECMA-262 10th Edition</refcontent>
</reference>

but in the generated XML, I get this content

<reference anchor="ECMA-262" target="https://www.ecma-international.org/ecma-262/10.0/index.html">
  <front>
    <title>ECMAScript 2019 Language Specification</title>
    <author>
      <organization>ECMA International</organization>
    </author>
    <date year="2019" month="June"></date>
  </front>
</reference>

Any reason why this would be the case?

miekg commented 3 years ago

That's because these are parsed and then outputted again. Refcontent is missing in the internal definition. Because the current xml3 lacks an RFC document, it's hard to keep track of updates

tmarkovski commented 3 years ago

Thanks for the quick response. I think I saw a reference to it at https://github.com/mmarkdown/mmark/blob/c5c8318c852efa4955e97ef049a2cd45672b74ac/mast/reference/reference.go#L82 , but I'm not sure if this is used. I assumed since its the struct, it should be understood.

I'll make sure to update my XML manually to get around this.

miekg commented 3 years ago

you are using mmark from the master branch?

On Wed, 18 Aug 2021, 17:02 Tomislav Markovski, @.***> wrote:

Thanks for the quick response. I think I saw a reference to it at https://github.com/mmarkdown/mmark/blob/c5c8318c852efa4955e97ef049a2cd45672b74ac/mast/reference/reference.go#L82 , but I'm not sure if this is used. I assumed since its the struct, it should be understood.

I'll make sure to update my XML manually to get around this.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mmarkdown/mmark/issues/142#issuecomment-901190029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACWIW2YMMENZ73BLG62LJDT5PDQ3ANCNFSM5CL53ZUQ .

tmarkovski commented 3 years ago

No, using a docker from https://github.com/oauthstuff/markdown2rfc, which I realize now points to a rather old release. I guess I should try use the latest form this repo.

miekg commented 3 years ago

Please do. Think I even triggered a release with this fix in it (omitempty might be a thing I need to add still)

On Wed, 18 Aug 2021, 19:44 Tomislav Markovski, @.***> wrote:

No, using a docker from https://github.com/oauthstuff/markdown2rfc, which I realize now points to a rather old release. I guess I should try use the latest form this repo.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mmarkdown/mmark/issues/142#issuecomment-901306964, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACWIW3HA7ZA3U5WIBK4GH3T5PWQRANCNFSM5CL53ZUQ .

tmarkovski commented 3 years ago

Latest master (2.2.16) worked, while latest from releases (2.2.10) didn't. I should've used the master version from the start. Thank you for the fast response!

miekg commented 3 years ago

I see that I didn't do any releases (due to using wrong github token). I've pushed 2.2.16 just now.