Fix bare autolink URL visibility in live-preview list items #361

Open
opened 2026-06-10 21:06:56 +00:00 by steve · 0 comments
Owner

Bare autolink URLs such as * http://www.g.com disappear in live-preview edit
mode because the rich-editor plugin hides all URL syntax tokens, including
standalone autolinks outside [label](url) syntax.

Problem

In live preview, tokenHidden applies cm-formatting-hidden to every URL
node. Bare external autolinks are entirely represented by that token, so the link
text is removed on inactive lines. Task-link overlay hiding is unrelated and
already scoped to task wikilinks only.

Goal

Keep bare external autolink URLs visible in live preview while continuing to
hide URL destination tokens inside [label](url) markdown links.

Scope

  • packages/plugins/plugin-markdown/src/lib/codemirror-extensions/rich-editor/index.ts
  • Unit and e2e regression coverage
  • spec/src/30-cross-package-contracts/editor-and-views.md

Non-goals

  • Changing task-link overlay behavior
  • Rendering bare autolinks as inline widgets instead of authored syntax

Acceptance Criteria

  • Inactive live-preview lines with * http://www.g.com show the URL text with
    external-link styling
  • [Example](https://example.com) still hides the destination URL on inactive
    lines while keeping the label visible
  • Unit and e2e tests cover the regression

Implementation Notes

Skip cm-formatting-hidden for bare external URL nodes where
parent?.name !== "Link" using the same condition as the existing
cm-external-link decoration pass.

Suggested Files or Specs To Inspect

  • packages/plugins/plugin-markdown/src/lib/codemirror-extensions/rich-editor/index.ts
  • packages/plugins/plugin-markdown/src/styles/live-preview.css
  • packages/workspace/e2e/markdown-rich-content.spec.ts

Validation Commands

  • pnpm --filter @lapis-notes/plugin-markdown test
  • pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-rich-content.spec.ts -g 'bare autolink'
  • pnpm check:all

Follow-up Tasks

Record deferred work or reviewer follow-ups here. pnpm backlog:start seeds the
PR pending-work log from this section.

Branch

  • Base ref:
  • Base revision:
  • Work branch / JJ bookmark:
  • Work change:

Pull Request

  • PR:
  • State:
  • Head SHA:
  • CI:

Regression Notes

  • Last known good:
  • Suspect change:
  • Validation command that catches this class of bug:

Implementation Summary

Populate when closing the issue.

Bare autolink URLs such as `* http://www.g.com` disappear in live-preview edit mode because the rich-editor plugin hides all `URL` syntax tokens, including standalone autolinks outside `[label](url)` syntax. ## Problem In live preview, `tokenHidden` applies `cm-formatting-hidden` to every `URL` node. Bare external autolinks are entirely represented by that token, so the link text is removed on inactive lines. Task-link overlay hiding is unrelated and already scoped to task wikilinks only. ## Goal Keep bare external autolink URLs visible in live preview while continuing to hide URL destination tokens inside `[label](url)` markdown links. ## Scope - `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/rich-editor/index.ts` - Unit and e2e regression coverage - `spec/src/30-cross-package-contracts/editor-and-views.md` ## Non-goals - Changing task-link overlay behavior - Rendering bare autolinks as inline widgets instead of authored syntax ## Acceptance Criteria - Inactive live-preview lines with `* http://www.g.com` show the URL text with external-link styling - `[Example](https://example.com)` still hides the destination URL on inactive lines while keeping the label visible - Unit and e2e tests cover the regression ## Implementation Notes Skip `cm-formatting-hidden` for bare external `URL` nodes where `parent?.name !== "Link"` using the same condition as the existing `cm-external-link` decoration pass. ## Suggested Files or Specs To Inspect - `packages/plugins/plugin-markdown/src/lib/codemirror-extensions/rich-editor/index.ts` - `packages/plugins/plugin-markdown/src/styles/live-preview.css` - `packages/workspace/e2e/markdown-rich-content.spec.ts` ## Validation Commands - `pnpm --filter @lapis-notes/plugin-markdown test` - `pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-rich-content.spec.ts -g 'bare autolink'` - `pnpm check:all` ## Related Issues ## Follow-up Tasks Record deferred work or reviewer follow-ups here. `pnpm backlog:start` seeds the PR pending-work log from this section. ## Branch - Base ref: - Base revision: - Work branch / JJ bookmark: - Work change: ## Pull Request - PR: - State: - Head SHA: - CI: ## Regression Notes - Last known good: - Suspect change: - Validation command that catches this class of bug: ## Implementation Summary Populate when closing the issue. <!-- backlog:temp=Tmq8k73l0dwdy task_id=TASK-MARKDOWN-BARE-AUTOLINK-LIVE-PREVIEW source_spec=spec/src/30-cross-package-contracts/editor-and-views.md -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#361
No description provided.