FHIR Chat · IG publisher - rendering of values in a markdown element · IG creation

Stream: IG creation

Topic: IG publisher - rendering of values in a markdown element


view this post on Zulip Rob Eastwood (Feb 14 2019 at 05:39):

Hello,
We are using a IG publishing template that displays the profiles' description value on the built html pages; ie the value in StructureDefinition.description. As it is a markdown datatype, we are experimenting with adding markdown content to do heading and dot-point lists, for example. And we are having difficulty getting the markdown rendered as expected without using special characters to represent line feed/carriage returns and asterisk for the dot points.

For example, using the markdown style of 2 spaces followed by enter to indicate a new line, and an asterisk for a dot point

<description  value="Line one
    * line two
    * line 3"/>

This gets rendered as this:
pasted image

However, if encoding characters are added as such:

<description  value="Line one&#13;&#10;&#13;&#10;&#42; line two&#13;&#10;&#42; line 3"/>

then its gets rendered like this:
pasted image

I have tried a number of variations and can only get the expected rendering using some form of special characters.

The question:
- is there a way to have the markdown content rendered as expected or should the special characters be used?
I note that the datatype description for markdown (R4) states this:

Markdown content SHALL NOT contain Unicode character points below 32, except for u0009 (horizontal tab), u0010 (carriage return) and u0013 (line feed)

Which reads like it is acceptable to include the characters as above; however, does that then result in the content of the string NOT being readable without markdown processing? (as the spec states it should not)

view this post on Zulip Jens Villadsen (Feb 14 2019 at 09:13):

tl;dr; - fill in the description part in forge in plain markdown- its my experience that it will for most parts do the transformation for you

view this post on Zulip Rob Eastwood (Feb 14 2019 at 22:52):

Thanks @Jens Villadsen

view this post on Zulip Grahame Grieve (Feb 17 2019 at 14:04):

did this sort out the problem? I found it an unexpected answer

view this post on Zulip Rob Eastwood (Feb 17 2019 at 22:28):

@Grahame Grieve - not so much 'resolved' but just transforming the markdown styling into the encoding characters in the xml, which then renders as intended by the original markdown.
So in Forge, this:
pasted image

gets transformed to this in xml:
pasted image

view this post on Zulip Eric Haas (Feb 18 2019 at 17:28):

I part of your answer lies in this answer here: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/markdown.20rendering/near/158556683

view this post on Zulip Eric Haas (Feb 18 2019 at 17:29):

if you have a mixed content ( html + md )within a block element the results are not always as expected... for example the end tag get interpreted as markdown and not html if on the same line

view this post on Zulip Eric Haas (Feb 18 2019 at 17:33):

using escapes can be a royal pain and I think this is where the limits of markdown ( which I love) is reached.


Last updated: Apr 12 2022 at 19:14 UTC