diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-10-09 20:39:40 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-10-09 20:39:40 -0400 |
commit | bfdbc495c0327b87ee0f896778968e65e2f18af6 (patch) | |
tree | f82f9d1896bbe03be22e01dcfb62b9d4f3943a95 /src/client/util/RichTextSchema.tsx | |
parent | e5e06155af44f86c7204ed5ce904f705186401db (diff) |
fixed rich text search highlights
Diffstat (limited to 'src/client/util/RichTextSchema.tsx')
-rw-r--r-- | src/client/util/RichTextSchema.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index 80bcf25ad..a5502577b 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -427,10 +427,13 @@ export const marks: { [index: string]: MarkSpec } = { }, search_highlight: { + attrs: { + selected: { default: false } + }, parseDOM: [{ style: 'background: yellow' }], - toDOM() { + toDOM(node: any) { return ['span', { - style: 'background: yellow' + style: `background: ${node.attrs.selected ? "orange" : "yellow"}` }]; } }, |