Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit afda261

Browse files
committed
Allow spans in editable html
The Medium Editor puts invisible spans in various places, don't remove them.
1 parent e898d22 commit afda261

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

js/utils/validateMediumEditor.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ function checkVal($field) {
1919
fVal = decodeHtml(fVal);
2020

2121
fVal = sanitizeHTML(fVal, {
22-
allowedTags: [ 'h2','h3', 'h4', 'h5', 'h6', 'p', 'a','u','ul', 'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'hr', 'br', 'img', 'blockquote' ],
23-
//allowedTags: [ 'h2','h3', 'h4', 'h5', 'h6', 'p','u','ul', 'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'hr', 'br', 'blockquote' ],
22+
allowedTags: [ 'h2','h3', 'h4', 'h5', 'h6', 'p', 'a','u','ul', 'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'hr', 'br', 'img', 'blockquote', 'span' ],
2423
allowedAttributes: {
2524
'a': [ 'href', 'title', 'alt' ],
2625
'img': [ 'src', 'style']
@@ -29,7 +28,6 @@ function checkVal($field) {
2928
return frame.tag === 'p' && !frame.text.trim();
3029
}
3130
});
32-
3331

3432
$field.val(fVal);
3533

0 commit comments

Comments
 (0)