Editor hashtag pill breaks when markdownlint decorates the line #155

Closed
opened 2026-05-30 21:14:52 +00:00 by steve · 0 comments
Owner

Source-mode #tag chips use two marks (cm-hashtag-begin on #, cm-hashtag-end on the name). Markdownlint and Harper spellcheck add cm-lintRange marks that can split across those boundaries and break pill borders, radii, and underlines.

Problem

#tag was fixed with generalized lint+hashtag CSS. #Tags / #Tags still broke because MD018 splits lint into two sibling cm-lintRange spans at column 2 (#+first letter | rest of name), not only trailing-space MD009.

Goal

CSS-only: keep two-part hashtag marks; connected pill when lint includes trailing whitespace after the tag name.

Scope

  • Extend editor-shared.css with .cm-hashtag-end + .cm-lintRange rules
  • Playwright screenshot for #Tags \n
  • Leave issue open until user confirms #Tags visually

Acceptance Criteria

  • #tag line with markdown lint: connected pill (prior fix)
  • #Tags and #Tags lines with markdown lint: connected pill (split lint ranges + optional trailing space)
  • Playwright screenshots for both cases
  • pnpm --filter @lapis-notes/markdown lint passes

Implementation Notes

Add trailing-sibling rules: flatten cm-hashtag-end right radius when followed by cm-lintRange; suppress underline on that lint segment.

Validation Commands

pnpm --filter @lapis-notes/markdown lint
pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-hashtag-lint.spec.ts

Implementation Summary

CSS in editor-shared.css keeps hashtag pills connected under lint: full-line wrap, MD018-style split at column 2, and trailing lint after cm-hashtag-end. Playwright screenshot tests cover #tag, #Tags, and #Tags (trailing space).

Reopen Reason

Regression: #Tags with trailing space breaks pill when MD009 lint follows cm-hashtag-end.

Source-mode `#tag` chips use two marks (`cm-hashtag-begin` on `#`, `cm-hashtag-end` on the name). Markdownlint and Harper spellcheck add `cm-lintRange` marks that can split across those boundaries and break pill borders, radii, and underlines. ## Problem `#tag` was fixed with generalized lint+hashtag CSS. `#Tags` / `#Tags ` still broke because MD018 splits lint into **two sibling** `cm-lintRange` spans at column 2 (`#`+first letter | rest of name), not only trailing-space MD009. ## Goal CSS-only: keep two-part hashtag marks; connected pill when lint includes trailing whitespace after the tag name. ## Scope - Extend `editor-shared.css` with `.cm-hashtag-end + .cm-lintRange` rules - Playwright screenshot for `#Tags \n` - Leave issue open until user confirms `#Tags ` visually ## Acceptance Criteria - [x] `#tag` line with markdown lint: connected pill (prior fix) - [ ] `#Tags` and `#Tags ` lines with markdown lint: connected pill (split lint ranges + optional trailing space) - [ ] Playwright screenshots for both cases - [ ] `pnpm --filter @lapis-notes/markdown lint` passes ## Implementation Notes Add trailing-sibling rules: flatten `cm-hashtag-end` right radius when followed by `cm-lintRange`; suppress underline on that lint segment. ## Validation Commands ```bash pnpm --filter @lapis-notes/markdown lint pnpm --filter @lapis-notes/workspace exec playwright test e2e/markdown-hashtag-lint.spec.ts ``` ## Implementation Summary CSS in editor-shared.css keeps hashtag pills connected under lint: full-line wrap, MD018-style split at column 2, and trailing lint after cm-hashtag-end. Playwright screenshot tests cover #tag, #Tags, and #Tags (trailing space). ## Reopen Reason Regression: #Tags with trailing space breaks pill when MD009 lint follows cm-hashtag-end. <!-- backlog:task_id=TASK-MARKDOWN-HASHTAG-LINT source_spec=spec/src/30-cross-package-contracts/editor-and-views.md -->
steve closed this issue 2026-05-30 22:05:33 +00:00
steve reopened this issue 2026-05-30 22:05:33 +00:00
steve closed this issue 2026-05-30 22:05:33 +00:00
steve added
done
and removed
open
labels 2026-05-30 22:13:42 +00:00
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#155
No description provided.