Commit ad760e06 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt

scroll to cite sink, when text is cited

parent bda50c10
import { includes } from 'lodash'
import { on, $, getAttr } from 'luett'
import stroll from 'stroll.js'
import getInputSelection from 'get-input-selection'
const DOMParser = window.DOMParser
......@@ -37,6 +38,7 @@ function citeSink (el, opts) {
const { bus } = opts.conf
const citeListener = bus.on(EVENT_CITE, data => {
stroll(el, { allowInvalidPositions: true })
const { end: position } = getInputSelection(el)
const pre = el.value.substr(0, position)
const post = el.value.substr(position)
......
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