Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(markdown): parse :::note's text as children #32510

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Sep 9, 2024

Two ways of fixing it, either:

a) Pass flattenText: falase to wrapText's options, but it seems to come from high up and overriding it only for :::note seems not great.
b) Parse the :::note's children as real MarkdownNotes and render them as real notes

I did b) in this case, which seems more reasonable.

Fixes #32505
Preview of the rolled docs: microsoft/playwright.dev#1534

This comment has been minimized.

utils/markdown.js Outdated Show resolved Hide resolved
@mxschmitt mxschmitt force-pushed the fix-markdown-notes branch 2 times, most recently from 5acc78d to cdd5bd5 Compare September 9, 2024 08:37

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the fix-markdown-notes branch 4 times, most recently from 85b9b49 to 0d97fc4 Compare September 11, 2024 12:17

This comment has been minimized.

utils/markdown.js Outdated Show resolved Hide resolved
@@ -802,12 +802,12 @@ function generateSourceCodeComment(spec) {
node.codeLang = parseCodeLang(node.codeLang).highlighter;
if (node.type === 'note') {
// @ts-ignore
node.type = 'text';
node.text = '**NOTE** ' + node.text;
node.type = 'text'
Copy link
Contributor

Choose a reason for hiding this comment

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

Why no semicolons?

Copy link
Member Author

Choose a reason for hiding this comment

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

its JS, we don't lint JS.

utils/doclint/documentation.js Outdated Show resolved Hide resolved

This comment has been minimized.

@mxschmitt mxschmitt force-pushed the fix-markdown-notes branch 2 times, most recently from 1762fef to e3368c8 Compare September 23, 2024 15:18

This comment has been minimized.

utils/markdown.js Outdated Show resolved Hide resolved
utils/markdown.js Outdated Show resolved Hide resolved
utils/markdown.js Outdated Show resolved Hide resolved
utils/markdown.js Outdated Show resolved Hide resolved

This comment has been minimized.

@mxschmitt mxschmitt changed the title docs(markdown): parse :::note's text as MD elements docs(markdown): parse :::note's text as children Sep 26, 2024

This comment has been minimized.

@mxschmitt mxschmitt merged commit 3b86a9c into microsoft:main Sep 26, 2024
29 checks passed
Copy link
Contributor

Test results for "tests 1"

1 flaky ⚠️ [chromium-page] › page/workers.spec.ts:228:3 › should support extra http headers

36383 passed, 747 skipped
✔️✔️✔️

Merge workflow run.

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.

[Docs]: NOTE in the Introduction / Clock page
2 participants