Commit 237a87be authored by Jorgen's avatar Jorgen

Fix context extraction

parent 91410325
......@@ -4,12 +4,12 @@ export default class ContextExtractor {
// Returns a context for a current selection
getContextForSelection() {
if (window.getSelection().baseNode === undefined) {
if (window.getSelection().anchorNode === undefined) {
return "";
}
const text = window.getSelection()
.baseNode.parentNode.textContent
.anchorNode.textContent
.replace(/\n/g,"")
.replace(/(\s)+/g, " ");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment