Stream: IG creation
Topic: Markdown within XML elements
Eric Haas (Aug 18 2020 at 19:13):
For proper markdown rendering within an xml element value
attribute need to use the code 

for line breaks.
for example to get
- foo
- bar
this does not work
- foo
- bar
but rather
- foo

- bar

is this something that can be fixed
Vassil Peytchev (Aug 18 2020 at 19:26):
XML attributes consider newline characters to be white space. My guess is that the publisher would have to pre-process the file and insert the XML representation for ASCII 10, before the XML is processed. It sounds like an error-prone and time consuming effort.
Eric Haas (Aug 18 2020 at 19:58):
I suspected as much. XML and markdown are enemies. I am using YAML and FSH going forward anyway so I will probably convert the existing XML to YAML.
Lloyd McKenzie (Aug 23 2020 at 21:03):
@Eric Haas Not understanding when you say you'll be using YAML - is YAML something explicitly supported with FSH? We don't want to introduce yet another file format...
Eric Haas (Aug 24 2020 at 16:10):
YML <--> JSON
Lloyd McKenzie (Aug 24 2020 at 16:40):
My point is that the source in Git needs to be consistent for all IGs. We allow XML & JSON & FSH. We're migrating from spreadsheets. We don't want to introduce YML without a pressing reason.
Brian Postlethwaite (Feb 19 2021 at 03:39):
I've just stumbled across this one too!
This is actually an issue with the XML format, and the http://hl7.org/fhir/R4/xml.html page is quiet on the subject of what to do with newline/linefeed characters.
https://www.w3.org/TR/2008/REC-xml-20081126/#sec-line-ends
This W3C recommendation suggests that all \r\n
s be replaced with just \n
s
I found this while implementing a faster parser using the low level .net XmlReader classes, which is different to what the current Firely parser does.
Last updated: Apr 12 2022 at 19:14 UTC