Closed Bug 2071286 Opened 2 months ago Closed 2 months ago

A mermaid diagram whose directive option wraps onto a second line is published as raw text

Categories

(Developer Infrastructure :: Source Documentation, defect)

defect

Tracking

(firefox158 fixed)

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

MyST stops parsing a directive's options at the first line that does not begin with a colon, so a wrapped :caption: continuation becomes the start of the directive body. Mermaid then sees prose ahead of the diagram keyword, fails to detect a diagram type, and the page ships the raw markup with the caption truncated to its first line. ./mach doc exits zero and logs nothing, so only a reader who opens the published page sees it.

Bug 2061048 fixed the four diagrams in the IPDL docs by moving their options to the YAML block form, but nothing stops the next author from hitting it -- the indented continuation was valid in reStructuredText, which these pages were converted from.

A build-time check that a mermaid block's body starts with a diagram type would turn this from a published defect into a build failure.

None of the tree's ninety-one mermaid blocks trips the check, and wrapping a caption again in browser/components/urlbar/docs/lifetime.md fails the build.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Attachment #9641984 - Attachment description: WIP: Bug 2071286 - Fail the docs build on a mermaid block that does not open with a diagram type. → Bug 2071286 - Fail the docs build on a mermaid block that does not open with a diagram type. r?#firefox-source-docs-reviewers!
Attachment #9641984 - Attachment description: Bug 2071286 - Fail the docs build on a mermaid block that does not open with a diagram type. r?#firefox-source-docs-reviewers! → Bug 2071286 - Fail the docs build on a mermaid block that opens with a wrapped directive option. r?#firefox-source-docs-reviewers!
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5a6cae2f3d8d https://hg.mozilla.org/integration/autoland/rev/f8bbccb471e6 Fail the docs build on a mermaid block that opens with a wrapped directive option. r=firefox-source-docs-reviewers,sylvestre
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: