notify-markdown-html

Converts markdown text into HTML based on the GOV.UK Notifications previews

Usage no npm install needed!

<script type="module">
  import notifyMarkdownHtml from 'https://cdn.skypack.dev/notify-markdown-html';
</script>

README

Notify-Markdown-HTML

Translates the markdown text used in the GOV.UK Notifications service to pure HTML

How to install

Either clone this repo

git clone https://github.com/KillerDom1123/Notify-Markdown-HTML.git

or install with npm

npm install notify-markdown-html

How to use it

Add the javascript file to your website, and use the command

html_body = markdownToHtml('#Hello World!')

Where #Hello World! would be the text containing your markup. This can be in a variable, etc.

The function returns a string with the HTML in it. Example:

html_body = `<h2 style="Margin: 0 0 20px 0; padding: 0; font-size: 27px; line- 35px; font-weight: bold; color: #0B0C0C;">Hello World!</h2>`