mmarkdown / mmark

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

Missing date in references leads to empty date leads to empty text #116

Closed robUx4 closed 4 years ago

robUx4 commented 4 years ago

This reference

<reference anchor="IEEE.754" target="https://standards.ieee.org/standard/754-2019.html">
  <front>
    <title>IEEE Standard for Binary Floating-Point Arithmetic</title>
    <author>
      <organization>IEEE</organization>
    </author>
  </front>
</reference>

generates

<reference anchor="IEEE.754" target="https://standards.ieee.org/standard/754-2019.html">
  <front>
    <title>IEEE Standard for Binary Floating-Point Arithmetic</title>
    <author>
      <organization>IEEE</organization>
    </author>
    <date></date>
  </front>
</reference>

which xml2rfc transforms into

[IEEE.754]
    IEEE, "IEEE Standard for Binary Floating-Point Arithmetic", , <https://standards.ieee.org/standard/754-2019.html>. 

Notice the empty text where the date would be , ,. I'm not sure xml2rfc should use an empty date but it's probably better not to output it if there is none.

miekg commented 4 years ago

[ Quoting notifications@github.com in "[mmarkdown/mmark] Missing date in r..." ]

This reference

IEEE Standard for Binary Floating-Point Arithmetic IEEE

generates

IEEE Standard for Binary Floating-Point Arithmetic IEEE

which xml2rfc transforms into

[IEEE.754] IEEE, "IEEE Standard for Binary Floating-Point Arithmetic", , https://standards.ieee.org/standard/754-2019.html.

Notice the empty text where the date would be , ,. I'm not sure xml2rfc should use an empty date but it's probably better not to output it if there is none.

Hmm, omitting an empty tag is harder than it seems in Go, omitempty doesn't immediately do the right thing here.

This seems to be mostly a xml2rfc bug...

robUx4 commented 4 years ago

Yes it seems the issue has been raised and supposedly fixed. I'm using xml2rfc 2.46 and it's supposed to be fixed in 2.24 but it doesn't work. Or it only recognizes <date/> and not <date></date>

miekg commented 4 years ago

[ Quoting notifications@github.com in "Re: [mmarkdown/mmark] Missing date ..." ]

Yes it seems the issue has been raised and supposedly fixed. I'm using xml2rfc 2.46 and it's supposed to be fixed in 2.24 but it doesn't work. Or it only recognizes and not

worth pinging the original issue or filing a new one. I'm my (lmimited) XML knowledge these things should be identical?

miekg commented 4 years ago

https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/450#comment:5