Refactoring the slicer engine for easier reuse

This commit is contained in:
Jermolene
2016-12-22 17:46:42 +00:00
parent ba9d6187af
commit a1a4bf0f9d
11 changed files with 199 additions and 168 deletions

View File

@@ -15,7 +15,7 @@ Handle slicing heading nodes
exports.processHeadingNode = function(domNode,tagName) {
if(domNode.nodeType === 1 && (tagName === "h1" || tagName === "h2" || tagName === "h3" || tagName === "h4")) {
var text = $tw.utils.htmlEncode(domNode.textContent);
var title = this.makeUniqueTitle("heading",text),
var title = this.makeUniqueTitle("heading " + text),
parentTitle = this.popParentStackUntil(tagName),
tags = [];
if(domNode.className && domNode.className.trim() !== "") {