mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
add tests for markdown node
This commit is contained in:
@@ -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">
|
||||
|
@@ -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">';
|
||||
|
@@ -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.
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user