diff options
| author | ab <abdullah_ahmed@brown.edu> | 2019-06-12 13:11:30 -0400 |
|---|---|---|
| committer | ab <abdullah_ahmed@brown.edu> | 2019-06-12 13:11:30 -0400 |
| commit | 22306895d56bcd59f7e993dee570b9b0722bd35d (patch) | |
| tree | 7efa724423c982cca807aa11c4f0c40a1506b4b0 /src | |
| parent | a4f5005fedae93bd4bb1529561acaa8d4f0474c5 (diff) | |
summarized text is underlined
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/util/RichTextSchema.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/util/RichTextSchema.tsx b/src/client/util/RichTextSchema.tsx index d1282403f..70729c0d9 100644 --- a/src/client/util/RichTextSchema.tsx +++ b/src/client/util/RichTextSchema.tsx @@ -451,6 +451,7 @@ export class ImageResizeView { } export class SummarizedView { + // TODO: highlight _collapsed: HTMLElement; constructor(node: any, view: any, getPos: any) { this._collapsed = document.createElement("span"); @@ -473,9 +474,10 @@ export class SummarizedView { node.attrs.visibility = !node.attrs.visibility; console.log("content is invisible"); let y = getPos(); + let mark = view.state.schema.mark(view.state.schema.marks.underline); console.log("PASTING " + node.attrs.oldtext.toString()); view.dispatch(view.state.tr.setSelection(TextSelection.create(view.state.doc, y + 1, y + 1))); - view.dispatch(view.state.tr.replaceSelection(node.attrs.oldtext)); + view.dispatch(view.state.tr.replaceSelection(node.attrs.oldtext).addMark(view.state.selection.from, view.state.selection.from + node.attrs.oldtextlen, mark)); //this._collapsed.textContent = "㊉"; } e.preventDefault(); |
