Skip to content

feat(core/best-practices): custom labels via data-label#5253

Draft
marcoscaceres wants to merge 3 commits intomainfrom
feat/3900-bp-labels
Draft

feat(core/best-practices): custom labels via data-label#5253
marcoscaceres wants to merge 3 commits intomainfrom
feat/3900-bp-labels

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

Closes #3900

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends core/best-practices so authors can override the default “Best Practice” marker and summary heading via data-label, with accompanying spec coverage. It fits into ReSpec’s document-generation pipeline by customizing how practice markers and the generated best-practices summary are rendered.

Changes:

  • Add data-label support for individual .practicelab markers.
  • Add data-label support for the #bp-summary heading text.
  • Add a spec covering custom labels in generated summary entries.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/core/best-practices.js Adds custom-label handling for practice markers and summary headings, plus a French marker string.
tests/spec/core/best-practices-spec.js Adds a spec asserting custom labels appear in summary items and heading text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/best-practices.js
Comment thread src/core/best-practices.js Outdated
Comment thread src/core/best-practices.js Outdated
@marcoscaceres marcoscaceres force-pushed the feat/3900-bp-labels branch from 9f778e1 to 99a17f4 Compare May 4, 2026 07:16
@marcoscaceres
Copy link
Copy Markdown
Contributor Author

@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed?

…; add boxed practice test coverage

Agent-Logs-Url: https://github.com/speced/respec/sessions/7c04e153-af93-4a0e-bfe4-3dc140064f8b

Co-authored-by: marcoscaceres <870154+marcoscaceres@users.noreply.github.com>
Only set lang attribute on the bdi element when using the built-in
l10n label. Custom data-label text inherits lang from its DOM context
naturally, so forcing it can produce incorrect language metadata for
assistive technology.

Also adds test for boxed practice container with custom label.
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.

Allow relabeling and multiple kinds of "best practice"

3 participants