Skip to content

Commit

Permalink
fix: šŸ› fix text highlight parseDOM (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leecason committed Apr 23, 2020
1 parent 5a1a948 commit b1dc509
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/extensions/text_highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ export default class TextHighlight extends Mark implements MenuBtnView {
inline: true,
group: 'inline',
parseDOM: [{
style: 'span[style*=background-color]',
getAttrs: color => {
tag: 'span[style*=background-color]',
getAttrs: (dom: HTMLElement) => {
const { backgroundColor } = dom.style;

return {
highlightColor: this.options.colors.includes(color) ? color : '',
highlightColor: backgroundColor,
};
},
}],
Expand Down

0 comments on commit b1dc509

Please sign in to comment.