Skip to content

Commit

Permalink
Fixed Eraser delete "<a>" tag! #705
Browse files Browse the repository at this point in the history
Issue: #705
  • Loading branch information
xdan committed Jul 23, 2021
1 parent 5fa6dcf commit edb812e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SPACE_REG_EXP_END = (): RegExp => /[\s\n\t\r\uFEFF\u200b]+$/g;

export const IS_BLOCK =
/^(ARTICLE|SCRIPT|STYLE|OBJECT|FOOTER|HEADER|NAV|SECTION|IFRAME|JODIT|JODIT-MEDIA|PRE|DIV|P|LI|UL|OL|H[1-6]|BLOCKQUOTE|TR|TD|TH|TBODY|THEAD|TABLE|BODY|HTML|FIGCAPTION|FIGURE|DT|DD|DL|DFN)$/i;
export const IS_INLINE = /^(STRONG|SPAN|I|EM|B|SUP|SUB)$/i;
export const IS_INLINE = /^(STRONG|SPAN|I|EM|B|SUP|SUB|A)$/i;

export const INSEPARABLE_TAGS: Array<keyof HTMLElementTagNameMap> = [
'img',
Expand Down
5 changes: 5 additions & 0 deletions test/tests/acceptance/plugins/cleanHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ describe('Clean html plugin', function () {
' pop '
],

[
'|<a href="#test">start</a> <span style="background-color: red; color: blue;">test test test|</span>',
'start test test test',
],

[
'start <strong>test test test|</strong>',
'start <strong>test test test</strong> pop ',
Expand Down

0 comments on commit edb812e

Please sign in to comment.