Skip to content

Commit

Permalink
fix: JiHong88#601 default whitelist - alt
Browse files Browse the repository at this point in the history
  • Loading branch information
JiHong88 authored and NickyTope committed Feb 11, 2021
1 parent d3c8078 commit a72ecd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ pasteTagsWhitelist : Whitelist of tags when pasting. default: _editorTagsWh
ex) 'p|h[1-6]'
attributesWhitelist : Add attributes whitelist of tags that should be kept undeleted from the editor. default: null {Object}
// -- Fixed whitelist --
// Native attributes: 'contenteditable|colspan|rowspan|target|href|download|rel|src|class|type|controls'
// Native attributes: 'contenteditable|colspan|rowspan|target|href|download|rel|src|alt|class|type|controls'
// Editor attributes: 'data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|origin-size|data-exp|data-font-size'
ex) {
'all': 'style|data-.+', // Apply to all tags
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -5015,7 +5015,7 @@ export default function (context, pluginCallButtons, plugins, lang, options, _re
this._disallowedTextTagsRegExp = disallowTextTags.length === 0 ? null : new wRegExp('(<\\/?)(' + disallowTextTags.join('|') + ')\\b\\s*(?:[^>^<]+)?\\s*(?=>)', 'gi');

// set whitelist
const defaultAttr = 'contenteditable|colspan|rowspan|target|href|download|rel|src|class|type|controls|data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|origin-size|data-exp|data-font-size';
const defaultAttr = 'contenteditable|colspan|rowspan|target|href|download|rel|src|alt|class|type|controls|data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|origin-size|data-exp|data-font-size';
this._allowHTMLComments = options._editorTagsWhitelist.indexOf('//') > -1;
this._htmlCheckWhitelistRegExp = new wRegExp('^(' + options._editorTagsWhitelist.replace('|//', '') + ')$', 'i');
this.editorTagsWhitelistRegExp = util.createTagsWhitelist(options._editorTagsWhitelist.replace('|//', '|<!--|-->'));
Expand Down

0 comments on commit a72ecd2

Please sign in to comment.