fix(link): ensure text blocks exist before referencing them (#3251)
Fixes #3250
This commit is contained in:
@@ -74,8 +74,9 @@ export function autolink(options: AutolinkOptions): Plugin {
|
|||||||
' ',
|
' ',
|
||||||
)
|
)
|
||||||
} else if (
|
} else if (
|
||||||
|
nodesInChangedRanges.length
|
||||||
// We want to make sure to include the block seperator argument to treat hard breaks like spaces
|
// We want to make sure to include the block seperator argument to treat hard breaks like spaces
|
||||||
newState.doc.textBetween(newRange.from, newRange.to, ' ', ' ').endsWith(' ')
|
&& newState.doc.textBetween(newRange.from, newRange.to, ' ', ' ').endsWith(' ')
|
||||||
) {
|
) {
|
||||||
textBlock = nodesInChangedRanges[0]
|
textBlock = nodesInChangedRanges[0]
|
||||||
textBeforeWhitespace = newState.doc.textBetween(
|
textBeforeWhitespace = newState.doc.textBetween(
|
||||||
|
|||||||
Reference in New Issue
Block a user