Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/editor/ReadingModeTaskLinkProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export class ReadingModeTaskLinkProcessor {
displayText = linkContent;
}

if (displayText) {
// If there's a display text (alias), do not replace the link
return;
}

// Create a task widget instance
const widget = new TaskLinkWidget(taskInfo, this.plugin, originalText, displayText);

Expand Down
8 changes: 6 additions & 2 deletions src/editor/TaskLinkOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,17 @@ export function buildTaskLinkDecorations(
: parseMarkdownLinkSync(link.match);
if (!parsed) continue;

const { linkPath } = parsed;

const { linkPath, displayText } = parsed;
// Validate link path
if (!linkPath || typeof linkPath !== "string" || linkPath.trim().length === 0) {
continue;
}

// Disable overlay if there's a display text (alias)
if (displayText) {
continue;
}

// Resolve the link path
const resolvedPath = resolveLinkPathSync(linkPath, currentFile, plugin);
if (!resolvedPath) continue;
Expand Down