Repository navigation
fix(toolbar): escape selectors in markdown audit export - #295
Conversation
Pipes and backticks in element selectors broke the findings table of the Markdown export. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the selector-sanitization change in Markdown audit-export tables.
No open issues 🎉
What changed in this PR
Fixes Markdown findings tables in the toolbar’s audit export when selectors contain pipes, backticks, or whitespace.
Changes:
- Adds
escapeMdCode()to escape pipes, replace backticks with apostrophes, and collapse whitespace. - Applies the helper to selectors before inserting them into exported table rows.
| File | Description |
|---|---|
src/view/frontend/web/js/toolbar/audits.js |
Sanitises selectors for inline code spans in Markdown findings tables. |
Review effort: Balanced
[Low impact] The PR appears safe to merge.
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
At widths ≤36rem, scope-less upcoming entries span both grid columns, forcing the PR link onto a separate row instead of preserving its right-hand placement.
No open issues 🎉
1 resolved since last review
Review effort: Balanced

Selectors (e.g. from ids or attribute-based labels) containing
|or backticks broke the findings table in the Markdown export. Pipes are now escaped, backticks replaced and whitespace collapsed before writing the code span.