add tests for markdown node

This commit is contained in:
Dave Conway-Jones
2019-07-05 23:54:27 +01:00
parent fef734486f
commit 84abd4bcb6
6 changed files with 122 additions and 4 deletions

View File

@@ -8,8 +8,12 @@
<script type="text/x-red" data-help-name="markdown">
<p>A function that converts the <code>msg.payload</code> in markdown format to html.</p>
<p>If the input is a string it tries to convert it to html.</p>
<p>If the input is a string it converts it to html.</p>
<p>All other message types are ignored.</p>
<p>Uses the markdown-it library - You can see a demo
<a href="https://markdown-it.github.io/">here</a>.</p>
<p>It is configured with html, linkify and typographer options turned on.</p>
</script>
<script type="text/javascript">

View File

@@ -2,7 +2,7 @@
module.exports = function(RED) {
"use strict";
var markdownNode = function(n) {
var md = require('markdown-it')({html:true, linkify:true});
var md = require('markdown-it')({html:true, linkify:true, typographer:true});
RED.nodes.createNode(this,n);
var node = this;
//<div id="nr-markdown" style="font-family:helvetica neue,arial,helvetica,sans-serif; margin:12px">';

View File

@@ -6,7 +6,7 @@ A <a href="http://nodered.org" target="_new">Node-RED</a> node to convert a mark
Install
-------
Run the following command in your Node-RED user directory - typically `~/.node-red`
Either use the `Node-RED Menu - Manage Palette - Install`, or run the following command in your Node-RED user directory - typically `~/.node-red`
npm install node-red-node-markdown
@@ -14,3 +14,7 @@ Usage
-----
If the input is a string it tries to convert it into an html string.
Uses the markdown-it library - You can see a demo <a href="https://markdown-it.github.io/" target="_new">here</a>.
It is configured with html, linkify and typographer options turned on.

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red-node-markdown",
"version" : "0.0.1",
"version" : "0.1.0",
"description" : "A Node-RED node to convert a markdown string to html.",
"dependencies" : {
"markdown-it": "^8.4.2"