Skip to content

Commit

Permalink
Fix: html format sanitizer function
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 25, 2016
1 parent dfb47a2 commit 6d17a64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,3 +684,7 @@ No changes. Erroneous version bump.
* HTML editor form fields using `trumbowyg`
* Field format for HTML
* Fix: Update `typeahead` front end component CSS

## Next

* Fix: `html` format sanitizer function
1 change: 0 additions & 1 deletion lib/forms/sanitizers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ exports = module.exports = {
.replace(/ \n|\n /g, '\n') // remove space before/after \n
.replace(/\n\n+/g, '\n') // replace double \n with single \n
.replace(/(<\s?\/\s?(p|h\d)\s?>|<\s?(br|hr)\s?\/?\s?>)/g, function(tag) {return tag + '\n';}) // add line breaks after </p>, </h1>, <br />, <hr />
.replace(/<\/h\d>/g, '</p>\n')
.replace(/^[ \n]|[ \n]$/g, ''); // trim space and \n off start and end
},
boolean: function(val) {
Expand Down

0 comments on commit 6d17a64

Please sign in to comment.