Skip to content

Commit 0f835f3

Browse files
committed
Revert "Disable the built-in bold matcher in Clipboard"
This reverts commit fa5e43d.
1 parent c9c5f45 commit 0f835f3

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

modules/clipboard.js

+5-19
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,7 @@ class Clipboard extends Module {
5757
[Node.ELEMENT_NODE, mQmatchAttributor],
5858
[Node.ELEMENT_NODE, matchStyles],
5959
['li', matchIndent],
60-
61-
/*
62-
This bit has been commented out for @evercoder specifically,
63-
as we have a FontWeight attributor rather than a Bold blot.
64-
*/
65-
// ['b', matchAlias.bind(matchAlias, 'bold')],
60+
['b', matchAlias.bind(matchAlias, 'bold')],
6661
['i', matchAlias.bind(matchAlias, 'italic')],
6762
['style', matchIgnore]
6863
].concat(this.options.matchers).forEach(([selector, matcher]) => {
@@ -371,19 +366,10 @@ function matchStyles(node, delta) {
371366
if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {
372367
formats.italic = true;
373368
}
374-
375-
/*
376-
377-
This bit has been commented out for @evercoder specifically,
378-
as we have a FontWeight attributor rather than a Bold blot.
379-
380-
*/
381-
382-
// if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||
383-
// parseInt(computeStyle(node).fontWeight) >= 700)) {
384-
// formats.bold = true;
385-
// }
386-
369+
if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||
370+
parseInt(computeStyle(node).fontWeight) >= 700)) {
371+
formats.bold = true;
372+
}
387373
if (Object.keys(formats).length > 0) {
388374
delta = applyFormat(delta, formats);
389375
}

0 commit comments

Comments
 (0)