Skip to content

Commit

Permalink
Merge pull request #845 from s-renier-taonix-fr/clean-html
Browse files Browse the repository at this point in the history
Fixed Eraser delete "<a>" tag! #705
  • Loading branch information
xdan committed May 16, 2022
2 parents 49bc4ee + af365dd commit d4a9cea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/plugins/fix/clean-html/clean-html.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ describe('Clean html plugin', function () {
],

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

[
Expand Down Expand Up @@ -119,7 +119,7 @@ describe('Clean html plugin', function () {
],
[
'<p><strong><em><u>as<span style="color: rgb(26, 188, 156);">da</span>s<span style="font-family: Impact,Charcoal,sans-serif;">da</span></u></em></strong><a href="https://xdan.ru/copysite/?lang=en"><strong><em><u><span style="font-family: Impact,Charcoal,sans-serif;">sds</span>a</u></em></strong></a><strong><em><u><s>d</s></u></em></strong></p>\n',
'<p>asdasdasdsad</p>\n'
'<p>asdasda<a href="https://xdan.ru/copysite/?lang=en">sdsa</a>d</p>\n'
]
].forEach(function (test) {
describe(`For "${test[0]}"`, function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function removeFormatForSelection(jodit: IJodit): void {
const shouldUnwrap: Node[] = [];

Dom.between(fakeLeft, fakeRight, node => {
if (isInlineBlock(node)) {
if (isInlineBlock(node) && !Dom.isTag(node, ['a'])) {
shouldUnwrap.push(node);
}

Expand Down

0 comments on commit d4a9cea

Please sign in to comment.