Fix MD018 false positives on valid ATX headings #210
Labels
No labels
abandoned
active
audit
blocked
data-safety
difficulty:easy
difficulty:hard
difficulty:high
difficulty:medium
docs
done
duplicate
notebook-v0
open
priority:high
ready
release-critical
safe-mode
spec
spec-backlog
subsystem:api
subsystem:backlog
subsystem:bases
subsystem:ci
subsystem:command
subsystem:configuration
subsystem:consolidate
subsystem:dependencies
subsystem:desktop-electron
subsystem:diffmerge
subsystem:docker
subsystem:docs
subsystem:fuzzy
subsystem:graph
subsystem:hotkeys
subsystem:lapis
subsystem:maint
subsystem:maintenance
subsystem:markdown
subsystem:markdown-lint
subsystem:md018
subsystem:notebook
subsystem:notifications
subsystem:opfs
subsystem:package
subsystem:plugin-markdown
subsystem:plugin-tasks
subsystem:plugins
subsystem:registry
subsystem:release
subsystem:renovate
subsystem:restore
subsystem:scripts
subsystem:search
subsystem:settings
subsystem:spec
subsystem:tasks
subsystem:testing
subsystem:ui
subsystem:web
subsystem:workspace
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lapis-notes/lapis#210
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The custom Lapis MD018 replacement currently reports false positives for valid
ATX headings with more than one hash, such as
## Start Here. The regression isin the shared
@lapis-notes/language-servicehelper, so both browser-worker andElectron markdown lint paths can surface the incorrect diagnostic.
Problem
The custom rule introduced to exempt lowercase Lapis tags from MD018 uses a
pattern that backtracks on multi-hash headings. As a result, valid headings like
## Start Herecan be interpreted as a single#heading followed by text thatstarts with
#, which incorrectly triggers MD018.Goal
Restore correct MD018 behavior so valid spaced ATX headings are not reported,
while malformed headings and lowercase tag exemptions continue to behave as
documented.
Scope
packages/language-service/src/markdownlint/options.tspackages/language-service/src/__tests__/markdownlint.test.tsheadings remain exempt from the replacement rule
Non-goals
handling
Acceptance Criteria
## Start Heredoes not report MD018 through the shared markdownlint helper# Introand### Deep Divedonot report MD018
#taskand#task Buy milkcontinue to avoid MD018
#Heading,##Section, and###foostillreport MD018
Implementation Notes
character are interpreted unambiguously
MD018disable behaviorunchanged so browser and Electron providers stay aligned
Suggested Files or Specs To Inspect
packages/language-service/src/markdownlint/options.tspackages/language-service/src/__tests__/markdownlint.test.tspackages/language-service/src/markdownlint/runtime.tsspec/src/20-packages/plugins/markdown-lint/index.mdValidation Commands
pnpm --filter @lapis-notes/language-service testpnpm --filter @lapis-notes/language-service check:allRelated Issues
Follow-up Tasks
Implementation Summary
Fixed the custom MD018 matcher so valid spaced ATX headings no longer false-positive, added regression coverage, and documented the corrected behavior.