1 | /**
|
2 | * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3 | * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4 | */
|
5 | /**
|
6 | * Removes the `<b>` tag wrapper added by Google Docs to a copied content.
|
7 | *
|
8 | * @param documentFragment element `data.content` obtained from clipboard
|
9 | */
|
10 | export default function removeBoldWrapper(documentFragment, writer) {
|
11 | for (const child of documentFragment.getChildren()) {
|
12 | if (child.is('element', 'b') && child.getStyle('font-weight') === 'normal') {
|
13 | const childIndex = documentFragment.getChildIndex(child);
|
14 | writer.remove(child);
|
15 | writer.insertChild(childIndex, child.getChildren(), documentFragment);
|
16 | }
|
17 | }
|
18 | }
|