From 543d243698597c8966f68f6914d0969ac45cc421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 12 Nov 2024 10:44:18 -0500 Subject: [PATCH 1/2] fix: remove redundant :::babel7 directive --- docs/parser.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/docs/parser.md b/docs/parser.md index a1ecd1d4cc..3066102dd1 100644 --- a/docs/parser.md +++ b/docs/parser.md @@ -348,18 +348,18 @@ When a plugin is specified multiple times, only the first options are considered - `decoratorsBeforeExport` (`boolean`) - By default decorators on exported classes can be placed either before or after the `export` keyword. When this option is set, decorators will only be allowed in the specified position. + By default decorators on exported classes can be placed either before or after the `export` keyword. When this option is set, decorators will only be allowed in the specified position. - ```js title="JavaScript" - // decoratorsBeforeExport: true - @dec - export class C {} + ```js title="JavaScript" + // decoratorsBeforeExport: true + @dec + export class C {} - // decoratorsBeforeExport: false - export @dec class C {} - ``` + // decoratorsBeforeExport: false + export @dec class C {} + ``` - :::caution + :::caution This option is deprecated and will be removed in a future version. Code that is valid when this option is explicitly set to `true` or `false` is also valid when this option is not set. ::: @@ -421,16 +421,13 @@ When a plugin is specified multiple times, only the first options are considered :::babel7 - - `importAttributes`: - `deprecatedAssertSyntax` (`boolean`, defaults to `false`) When `true`, allow parsing an old version of the import attributes, which used the `assert` keyword instead of `with`. - :::babel7 This matches the syntax originally supported by the `importAssertions` parser plugin. - ::: ::: From 6d580b94dfd2602b6e147e5215692eb0f4b8c20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 12 Nov 2024 11:39:43 -0500 Subject: [PATCH 2/2] fix: support Babel 8 directive in list items --- website/docusaurus.config.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 7ec29197e5..64359acb85 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -111,8 +111,10 @@ function remarkDirectiveBabel8Plugin({ renderBabel8 }) { children.splice(index, 1, ...node.children); } } else { - transformer(node); // for support inside ::tip, etc + transformer(node); // inside :::tip, etc } + } else if (Array.isArray(node.children)) { + transformer(node); // inside list items } } };