From 6edbdab303e2d434f5a36686f077f11dfd8f3640 Mon Sep 17 00:00:00 2001
From: ilmar
Date: Thu, 26 Apr 2018 12:02:48 +0300
Subject: [PATCH] Html export update
---
index.js | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/index.js b/index.js
index 87c0ec4..32f1856 100644
--- a/index.js
+++ b/index.js
@@ -32,14 +32,15 @@ exports.exportHtmlAdditionalTags = function(hook, pad, cb){
};
// line, apool,attribLine,text
-exports.getLineHTMLForExport = function (hook, line) {
- var contextV = _analyzeLine(line.attribLine, line.apool);
+exports.getLineHTMLForExport = function (hook, context) {
+ var contextV = _analyzeLine(context.attribLine, context.apool);
// If it has a context
if(contextV){
var contexts = contextV.split("$");
}else{
- return line.lineContent + "
";
+ context.lineContent = context.lineContent + "
";
+ return true;
}
var before = "";
@@ -77,10 +78,12 @@ exports.getLineHTMLForExport = function (hook, line) {
after += "
";
});
// Remove leading * else don't..
- var newString = before + line.lineContent.substring(1) + after + "
";
- return newString;
- }else{ // no context, nothing to remove
- return line.lineContent;
+ if (context.lineContent[0] === '*') {
+ context.lineContent = context.lineContent.substring(1)
+ }
+
+ context.lineContent = before + context.lineContent + after + "
";
+ return true;
}
}