convert-rich-text
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -50,2 +50,4 @@ var dom = require('./dom'); | ||
this.line.appendChild(node); | ||
// TODO: loop through in priority order | ||
@@ -61,3 +63,2 @@ // TODO: each format function returns a promise | ||
// TODO: optimize line? | ||
this.line.appendChild(node); | ||
}; | ||
@@ -64,0 +65,0 @@ |
{ | ||
"name": "convert-rich-text", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Convert an insert-only rich-text delta into HTML", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -87,4 +87,6 @@ # convert-rich-text | ||
Each line of rich-text is wrapped with a block element (default <div>). | ||
attribute-, class- and style-based formats wrap text with an inline element if there is no other tag to work on (default <span>). | ||
Each line of rich-text is wrapped with a block element (default `<div>`). | ||
attribute-, class- and style-based formats wrap text with an inline element if there is no other tag to work on (default `<span>`). | ||
You can change these tags with the `blockTag` and `inlineTag` options: | ||
@@ -91,0 +93,0 @@ |
@@ -11,10 +11,13 @@ var assert = require('chai').assert; | ||
reverse: function(node) { | ||
return document.createTextNode(node.textContent.split('').reverse().join('')); | ||
var newNode = document.createTextNode(node.textContent.split('').reverse().join('')); | ||
node.parentNode.replaceChild(newNode, node); | ||
return newNode; | ||
}, | ||
repeat: function(node, value) { | ||
var wrapper = document.createDocumentFragment(); | ||
var frag = document.createDocumentFragment(); | ||
for (var i = 0, n = parseInt(value); i < n; i++) { | ||
wrapper.appendChild(node.cloneNode(true)); | ||
frag.appendChild(node.cloneNode(true)); | ||
} | ||
return wrapper; | ||
node.parentNode.replaceChild(frag, node); | ||
return frag; | ||
} | ||
@@ -21,0 +24,0 @@ }; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25303
479
100
0