Skip to content

docs: fix default class tutorial tag matching - #1091

Open
sridharkalaibala wants to merge 1 commit into
showdownjs:developfrom
sridharkalaibala:docs/default-class-tag-matching
Open

sridharkalaibala wants to merge 1 commit into
showdownjs:developfrom
sridharkalaibala:docs/default-class-tag-matching

Conversation

@sridharkalaibala

Copy link
Copy Markdown

Fixes #1026.

The CSS-class tutorial's greedy expression consumes the rest of the line, so two links on one line receive a class only on the first link. It can also match article or abbr when the configured tag is a.

Match only the opening tag name with a whitespace-or-> boundary, and insert the class immediately after it. Attributes remain untouched, including quoted > characters and attributes on multiple lines. Add a short explanation to the tutorial.

Five regression checks execute the bindings extracted from the documented snippet through the actual converter: repeated links, tag-name prefixes, quoted angle brackets, multiline attributes, and the tutorial's list classes. All five fail before the change (the list case differs only in redundant whitespace) and pass afterward.

Validation: npm test passes all 3,179 tests across 26 files; ESLint reports no errors and one existing unused-variable warning in decodeEntities.js. git diff --check passes. Based on develop as requested by CONTRIBUTING.md. No library runtime code or dependencies changed; no browser matrix was run for this documentation example.

Prepared with OpenAI Codex assistance and validated locally on Node 24 / Windows.

This branch has not been deployed

No deployments
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