浏览代码

Preserved newlines in exported Markdown

Ryan Atkinson 4 年之前
父节点
当前提交
c9c70a3b8f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      _layouts/rule.html

+ 2 - 2
_layouts/rule.html

@@ -210,9 +210,9 @@ https://github.com/Bernardo-Castilho/dragdroptouch -->
   
   // end RuleBuilder functions
 
-  // Removes all HTML content
+  // Removes all HTML content, replacing line break tags with newlines
   function stripHTML(input) {
-      input = input.replace(/(<([^>]+)>)/ig,'');
+      input = input.replace(/<br ?\/?>/ig, "\n").replace(/(<([^>]+)>)/ig,'');
       return input;
   }