Skip to content

Commit

Permalink
Don't sanitise existing ids from h1..h6, refs Mermade#21
Browse files Browse the repository at this point in the history
MikeRalphson committed Dec 19, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d3d4b29 commit a96e53f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -160,7 +160,8 @@ function clean(s) {
'summary', 'abbr', 'meta', 'link' ]),
allowedAttributes: { a: [ 'href', 'name', 'target', 'class' ], img: [ 'src', 'alt', 'class' ] , aside: [ 'class' ],
abbr: [ 'title', 'class' ], details: [ 'open', 'class' ], div: [ 'class' ], meta: [ 'name', 'content' ],
link: [ 'rel', 'href', 'type', 'sizes' ] }
link: [ 'rel', 'href', 'type', 'sizes' ],
h1: [ 'id' ], h2: [ 'id' ], h3: [ 'id' ], h4: [ 'id' ], h5: [ 'id' ], h6: [ 'id' ]}
};
// replace things which look like tags which sanitizeHtml will eat
s = s.split('\n>').join('\n$1$');

0 comments on commit a96e53f

Please sign in to comment.