mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 22:10:24 +08:00
parent
991441190d
commit
d9f64bab58
@ -34,13 +34,14 @@ const updateCtrl = ContentState => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContentState.prototype.checkNeedRender = function (cursor = this.cursor) {
|
ContentState.prototype.checkNeedRender = function (cursor = this.cursor) {
|
||||||
|
const { labels } = this.stateRender
|
||||||
const { start: cStart, end: cEnd } = cursor
|
const { start: cStart, end: cEnd } = cursor
|
||||||
const startBlock = this.getBlock(cStart.key)
|
const startBlock = this.getBlock(cStart.key)
|
||||||
const endBlock = this.getBlock(cEnd.key)
|
const endBlock = this.getBlock(cEnd.key)
|
||||||
const startOffset = cStart.offset
|
const startOffset = cStart.offset
|
||||||
const endOffset = cEnd.offset
|
const endOffset = cEnd.offset
|
||||||
|
|
||||||
for (const token of tokenizer(startBlock.text)) {
|
for (const token of tokenizer(startBlock.text, undefined, undefined, labels)) {
|
||||||
if (token.type === 'text') continue
|
if (token.type === 'text') continue
|
||||||
const { start, end } = token.range
|
const { start, end } = token.range
|
||||||
const textLen = startBlock.text.length
|
const textLen = startBlock.text.length
|
||||||
@ -50,7 +51,7 @@ const updateCtrl = ContentState => {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const token of tokenizer(endBlock.text)) {
|
for (const token of tokenizer(endBlock.text, undefined, undefined, labels)) {
|
||||||
if (token.type === 'text') continue
|
if (token.type === 'text') continue
|
||||||
const { start, end } = token.range
|
const { start, end } = token.range
|
||||||
const textLen = endBlock.text.length
|
const textLen = endBlock.text.length
|
||||||
|
@ -203,7 +203,6 @@ class Keyboard {
|
|||||||
if (!start || !end) {
|
if (!start || !end) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!this.isComposed
|
!this.isComposed
|
||||||
) {
|
) {
|
||||||
|
@ -6,6 +6,7 @@ export default function referenceLink (h, cursor, block, token, outerClass) {
|
|||||||
const labelClass = className === CLASS_OR_ID['AG_GRAY']
|
const labelClass = className === CLASS_OR_ID['AG_GRAY']
|
||||||
? CLASS_OR_ID['AG_REFERENCE_LABEL']
|
? CLASS_OR_ID['AG_REFERENCE_LABEL']
|
||||||
: className
|
: className
|
||||||
|
|
||||||
const { start, end } = token.range
|
const { start, end } = token.range
|
||||||
const {
|
const {
|
||||||
anchor,
|
anchor,
|
||||||
|
Loading…
Reference in New Issue
Block a user