Help with converting Markdown Variable to HTML Variable

Hi everyone,

I would like to convert a variable with Markdown formatted text to a variable with HTML. I’d like to do this in the background, i.e. silently.

E.g. variable contains text:

# Title

Regular text

and I’d like it to be converted / transformed to the following:

<h1>Title</h1>

<p>Regular text</p>

I believe I could use the Markdown perl script for this (http://daringfireball.net/projects/markdown/), but I can’t figure out how to ‘pass’ the variable into the script, or get the desired HTML result back! Any help would be really appreciated! Thank you,

Andy.

You can pass KM variables to the shell with $KMVAR_<variable>. There is a nice KM Wiki article with all details.

To get the result back to KM you simply set the Execute Shell Script action to save results to variable.

1 Like

Thanks Tom.