Skip to content

fix(deflist): map complete term source lines - #26

Open
awais-ur-rehman wants to merge 1 commit into
markdown-it:masterfrom
awais-ur-rehman:feat/map-definition-term-lines
Open

awais-ur-rehman wants to merge 1 commit into
markdown-it:masterfrom
awais-ur-rehman:feat/map-definition-term-lines

Conversation

@awais-ur-rehman

Copy link
Copy Markdown

Summary

Definition terms currently report map: [line, line] for both dt_open and its inline token. That describes an empty source range: code that associates a source line with its preview token using start <= line && line < end cannot match a term. Use line + 1 as the exclusive end, matching a one-line paragraph's map.

Tests check the term and inline ranges for a single term, multiple terms, a term inside a blockquote and a term after a paragraph. A paragraph comparison verifies the exclusive-end convention. Rendered output is unchanged and the existing fixture/build tests continue to pass.

Testing

Validation on Node.js 24.19.0: npm test (ESLint, Rollup builds and complete node:test suite), plus git diff --check. All five source-map regressions failed before the fix. No browser integration was run locally.

Assisted by OpenAI Codex for diagnosis, implementation and test execution.

Breaking Changes

None.

Manual verification: Parse a one-line definition term: dt_open and its inline token should both map to [line, line + 1], consistent with a one-line paragraph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant