Closed ajeanmahoney closed 1 year ago
Thanks. I think just making source code output CDATA makes a lot of sense, the only thing that might clash here are callouts, but prolly little used and you can always use plain artwork for those.
Should not be too hard to make such a change.
Can you try the branch in #187 ?
Thanks for the quick response!
I set up the Go environment, checked out the cdata branch, built mmark, and converted the draft-oauth-rar md file into XML. However, I'm still seeing escape codes in <sourcecode>
and no use of CDATA. Maybe I'm missing something?
[ Quoting @.***> in "Re: [mmarkdown/mmark] Enhancement: ..." ]
Thanks for the quick response!
I set up the Go environment, checked out the cdata branch, built mmark, and converted the draft-oauth-rar md file into XML. However, I'm still seeing escape codes in
and no use of CDATA. Maybe I'm missing something?
Odd, if I use:
## Common Configurations
A host can participate in the domain name system in a number of ways,
```
Local Host | Foreign
|
+---------+ +----------+ | +--------+
| | user queries | |queries | | |
| User |-------------->| |---------|->|Foreign |
| Program | | Resolver | | | Name |
| |<--------------| |<--------|--| Server |
| | user responses| |responses| | |
+---------+ +----------+ | +--------+
| A |
cache additions | | references |
V | |
+----------+ |
| cache | |
+----------+ |
```
converts to:
% ./mmark x.md
<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<section anchor="common-configurations"><name>Common Configurations</name>
<t>A host can participate in the domain name system in a number of ways,</t>
<artwork><![CDATA[ Local Host | Foreign
|
+---------+ +----------+ | +--------+
| | user queries | |queries | | |
| User |-------------->| |---------|->|Foreign |
| Program | | Resolver | | | Name |
| |<--------------| |<--------|--| Server |
| | user responses| |responses| | |
+---------+ +----------+ | +--------+
| A |
cache additions | | references |
V | |
+----------+ |
| cache | |
+----------+ |
]]>
</artwork>
</section>
</section>
fixed by #187
Description
When mmark converts an Internet-Draft written in markdown to an xml2rfc v3 file, it substitutes
"
for double quotation marks ("
) and<
and>
for angle brackets (<>
). This renders fine in the various outputs of xml2rfc.However, this escaping becomes problematic for text that is wrapped in
<sourcecode>
, which should be extractable from the XML and usable upon extraction. For example, this JSON example in<sourcecode>
should look like this (using CDATA):Rather than this:
What version of mmark are you using?
This is seen with versions 2.2.31 and 2.2.30
What is the most minimal markdown snippets that shows the problem?
Although not minimal, there are plenty of examples in the following: https://github.com/oauthstuff/draft-oauth-rar