From ec3cd2a0f599542d6ff3a3052a4aa891c2adbdab Mon Sep 17 00:00:00 2001 From: yzhe819 Date: Sun, 7 Aug 2022 22:59:46 +1200 Subject: [PATCH 1/4] fix: line numbers display issue of code block --- .../src/theme/CodeBlock/Line/styles.module.css | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/docusaurus-theme-classic/src/theme/CodeBlock/Line/styles.module.css b/packages/docusaurus-theme-classic/src/theme/CodeBlock/Line/styles.module.css index c769c64f403b..454874ff256d 100644 --- a/packages/docusaurus-theme-classic/src/theme/CodeBlock/Line/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/CodeBlock/Line/styles.module.css @@ -35,6 +35,7 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus left: 0; padding: 0 var(--ifm-pre-padding); background: var(--ifm-pre-background); + overflow-wrap: normal; } .codeLineNumber::before { From a2735c4b0f5973bc480f662c9769ca602b9f6ad3 Mon Sep 17 00:00:00 2001 From: yzhe819 Date: Sun, 7 Aug 2022 23:14:47 +1200 Subject: [PATCH 2/4] test: add dogfooding test page --- website/_dogfooding/_docs tests/code-wrap-test.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 website/_dogfooding/_docs tests/code-wrap-test.md diff --git a/website/_dogfooding/_docs tests/code-wrap-test.md b/website/_dogfooding/_docs tests/code-wrap-test.md new file mode 100644 index 000000000000..8c695eae3072 --- /dev/null +++ b/website/_dogfooding/_docs tests/code-wrap-test.md @@ -0,0 +1,15 @@ +# Doc with code + +```jsx showLineNumbers +import React from 'react'; +import Layout from '@theme/Layout'; + +export default function MyReactPage() { + return ( + +

My React page

+

This is a React page. Let's make this sentence bit long. Some more words to make sure... Some more words to make sure... Some more words to make sure...

+
+ ); +} +``` \ No newline at end of file From bcda7b7e8ff4bad88fe92f35cb198de1f6597089 Mon Sep 17 00:00:00 2001 From: yzhe819 Date: Mon, 8 Aug 2022 02:40:57 +1200 Subject: [PATCH 3/4] chore: lint --- website/_dogfooding/_docs tests/code-wrap-test.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/_dogfooding/_docs tests/code-wrap-test.md b/website/_dogfooding/_docs tests/code-wrap-test.md index 8c695eae3072..28de44a818b5 100644 --- a/website/_dogfooding/_docs tests/code-wrap-test.md +++ b/website/_dogfooding/_docs tests/code-wrap-test.md @@ -8,8 +8,12 @@ export default function MyReactPage() { return (

My React page

-

This is a React page. Let's make this sentence bit long. Some more words to make sure... Some more words to make sure... Some more words to make sure...

+

+ This is a React page. Let's make this sentence bit long. Some more words + to make sure... Some more words to make sure... Some more words to make + sure... +

); } -``` \ No newline at end of file +``` From e08a77ba5660a4e49fba199839c25831060087e7 Mon Sep 17 00:00:00 2001 From: yzhe819 Date: Mon, 8 Aug 2022 02:51:11 +1200 Subject: [PATCH 4/4] test: move to code-block-tests --- .../_dogfooding/_docs tests/code-wrap-test.md | 19 ------------------- .../_pages tests/code-block-tests.mdx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 website/_dogfooding/_docs tests/code-wrap-test.md diff --git a/website/_dogfooding/_docs tests/code-wrap-test.md b/website/_dogfooding/_docs tests/code-wrap-test.md deleted file mode 100644 index 28de44a818b5..000000000000 --- a/website/_dogfooding/_docs tests/code-wrap-test.md +++ /dev/null @@ -1,19 +0,0 @@ -# Doc with code - -```jsx showLineNumbers -import React from 'react'; -import Layout from '@theme/Layout'; - -export default function MyReactPage() { - return ( - -

My React page

-

- This is a React page. Let's make this sentence bit long. Some more words - to make sure... Some more words to make sure... Some more words to make - sure... -

-
- ); -} -``` diff --git a/website/_dogfooding/_pages tests/code-block-tests.mdx b/website/_dogfooding/_pages tests/code-block-tests.mdx index 44db91d49094..2c955e110cb4 100644 --- a/website/_dogfooding/_pages tests/code-block-tests.mdx +++ b/website/_dogfooding/_pages tests/code-block-tests.mdx @@ -249,3 +249,21 @@ echo "short_initially_hidden_string" [// spell-checker:enable]: # + +```jsx showLineNumbers +import React from 'react'; +import Layout from '@theme/Layout'; + +export default function MyReactPage() { + return ( + +

My React page

+

+ This is a React page. Let's make this sentence bit long. Some more words + to make sure... Some more words to make sure... Some more words to make + sure... +

+
+ ); +} +```