Browse Source

Merge branch 'preserve-newlines' into 'master'

Preserved newlines in exported Markdown

See merge request medlabboulder/communityrule!3
Nathan Schneider 4 years ago
parent
commit
6f5911017f
1 changed files with 2 additions and 2 deletions
  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;
   }