We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 051a06a commit 2dfba92Copy full SHA for 2dfba92
src/markup/codemirror/create.ts
@@ -237,9 +237,13 @@ export function createCodemirror(params: CreateCodemirrorParams) {
237
238
if (parseInsertedUrlAsImage) {
239
const linkMatches = currentLine.matchAll(linkRegex);
240
+ const cursorPositionInCurrentLine = from - line.from;
241
const isInsertedInsideLink = linkMatches.some(
- (item) => from >= item.index && from <= item.index + (item[0]?.length ?? 0),
242
+ (item) =>
243
+ cursorPositionInCurrentLine >= item.index &&
244
+ cursorPositionInCurrentLine <= item.index + (item[0]?.length ?? 0),
245
);
246
+
247
if (!isInsertedInsideLink) {
248
const {imageUrl, title} =
249
parseInsertedUrlAsImage(
0 commit comments