This is an automated email from the ASF dual-hosted git repository. kassiez pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new 04e1970aa5 [chore]:Improve the md-bold-plugin plugin (#1753) 04e1970aa5 is described below commit 04e1970aa58d5bac36862593e96b43a7102c8121 Author: yangon <2689991...@qq.com> AuthorDate: Tue Jan 14 17:51:49 2025 +0800 [chore]:Improve the md-bold-plugin plugin (#1753) --- config/markdown-bold-plugin.js | 53 ++++++++++++---------- docs/admin-manual/cluster-management/time-zone.md | 2 +- docusaurus.config.js | 1 + src/theme/SearchBar/SearchBar.module.css | 2 +- .../admin-manual/cluster-management/time-zone.md | 2 +- .../admin-manual/cluster-management/time-zone.md | 2 +- .../admin-manual/cluster-management/time-zone.md | 2 +- 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/config/markdown-bold-plugin.js b/config/markdown-bold-plugin.js index d622b2a2c8..d37af90f80 100644 --- a/config/markdown-bold-plugin.js +++ b/config/markdown-bold-plugin.js @@ -1,35 +1,32 @@ const { visit } = require('unist-util-visit'); function getFirstBoldContent(str, startIdx = 0) { - const strArr = str.split(""); + const strArr = str.split(''); for (let i = startIdx; i < strArr.length; i++) { - if ( - strArr[i - 1] !== "*" && - strArr[i] === "*" && - strArr[i + 1] === "*" && - strArr[i + 2] !== "*" - ) { - // start with ** - let j; - for (j = i + 2; j < strArr.length; j++) { - if ( - strArr[j - 1] !== "*" && - strArr[j] === "*" && - strArr[j + 1] === "*" && - strArr[j + 2] !== "*" - ) { - // end with ** - return { - start: i, - end: j, - }; - } + if (strArr[i - 1] !== '*' && strArr[i] === '*' && strArr[i + 1] === '*' && strArr[i + 2] !== '*') { + // start with ** + let j; + for (j = i + 2; j < strArr.length; j++) { + if (strArr[j - 1] !== '*' && strArr[j] === '*' && strArr[j + 1] === '*' && strArr[j + 2] !== '*') { + // end with ** + return { + start: i, + end: j, + }; + } + } } - } } return null; - } +} +/** + * @description + * + * A plugin to handle the problem that bold formatting is not effective + * + * Tip: if the plugin source code does not take effect after modification, it may need to be rebuilt. + */ const plugin = options => { const transformer = async (ast, file) => { visit(ast, 'text', (node, index, parent) => { @@ -60,7 +57,13 @@ const plugin = options => { }); } console.warn( - `The bold syntax of "${value}" in "${file.path}" is invalid and is being automatically optimized`, + `[WARNING] The bold syntax of "${value}" in "${file.path}" is invalid and is being automatically optimized`, + ); + } else if (/(?<!\*)\*\*(?!\*)/.test(node.value)) { + // When there are multiple bold syntax in the text that does not take effect, you need to modify it manually + // For example: aa**test1:**bb**test2:**cc will be rendered as aa**test1:<strong>bb</strong>test2:**cc + console.warn( + `[WARNING] markdownBoldPlugin found a ** in the text node (${node.value}) of the file ${file.path}, which may cause the document to not render as expected`, ); } }); diff --git a/docs/admin-manual/cluster-management/time-zone.md b/docs/admin-manual/cluster-management/time-zone.md index 3d9bcc7b07..73e2c7b0f0 100644 --- a/docs/admin-manual/cluster-management/time-zone.md +++ b/docs/admin-manual/cluster-management/time-zone.md @@ -236,7 +236,7 @@ wget https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz Then generate the specific zoneinfo data according the README file in the extracted folder. The generated data should be copied to override `$TZDIR` folder. -Please note that all the above operations **must** be restarted **on the corresponding BE to take effect after they are done on the BE machine. +Please note that all the above operations **must** be restarted on the corresponding BE to take effect after they are done on the BE machine. ## Extended Reading diff --git a/docusaurus.config.js b/docusaurus.config.js index a772633ba9..32dfdf8ade 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -180,6 +180,7 @@ const config = { blogSidebarCount: 0, showReadingTime: false, onUntruncatedBlogPosts: 'ignore', + onInlineAuthors: 'ignore', }, theme: { customCss: require.resolve('./src/scss/custom.scss'), diff --git a/src/theme/SearchBar/SearchBar.module.css b/src/theme/SearchBar/SearchBar.module.css index 39d9af8c82..f4ed19d3c1 100644 --- a/src/theme/SearchBar/SearchBar.module.css +++ b/src/theme/SearchBar/SearchBar.module.css @@ -201,7 +201,7 @@ html[data-theme="dark"] .noResultsIcon { display: none; position: absolute; left: 10px; - top: 6px; + top: 10px; } .searchBarContainer .searchClearButton { diff --git a/versioned_docs/version-2.0/admin-manual/cluster-management/time-zone.md b/versioned_docs/version-2.0/admin-manual/cluster-management/time-zone.md index 3d9bcc7b07..73e2c7b0f0 100644 --- a/versioned_docs/version-2.0/admin-manual/cluster-management/time-zone.md +++ b/versioned_docs/version-2.0/admin-manual/cluster-management/time-zone.md @@ -236,7 +236,7 @@ wget https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz Then generate the specific zoneinfo data according the README file in the extracted folder. The generated data should be copied to override `$TZDIR` folder. -Please note that all the above operations **must** be restarted **on the corresponding BE to take effect after they are done on the BE machine. +Please note that all the above operations **must** be restarted on the corresponding BE to take effect after they are done on the BE machine. ## Extended Reading diff --git a/versioned_docs/version-2.1/admin-manual/cluster-management/time-zone.md b/versioned_docs/version-2.1/admin-manual/cluster-management/time-zone.md index 3d9bcc7b07..73e2c7b0f0 100644 --- a/versioned_docs/version-2.1/admin-manual/cluster-management/time-zone.md +++ b/versioned_docs/version-2.1/admin-manual/cluster-management/time-zone.md @@ -236,7 +236,7 @@ wget https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz Then generate the specific zoneinfo data according the README file in the extracted folder. The generated data should be copied to override `$TZDIR` folder. -Please note that all the above operations **must** be restarted **on the corresponding BE to take effect after they are done on the BE machine. +Please note that all the above operations **must** be restarted on the corresponding BE to take effect after they are done on the BE machine. ## Extended Reading diff --git a/versioned_docs/version-3.0/admin-manual/cluster-management/time-zone.md b/versioned_docs/version-3.0/admin-manual/cluster-management/time-zone.md index 3d9bcc7b07..73e2c7b0f0 100644 --- a/versioned_docs/version-3.0/admin-manual/cluster-management/time-zone.md +++ b/versioned_docs/version-3.0/admin-manual/cluster-management/time-zone.md @@ -236,7 +236,7 @@ wget https://www.iana.org/time-zones/repository/tzdb-latest.tar.lz Then generate the specific zoneinfo data according the README file in the extracted folder. The generated data should be copied to override `$TZDIR` folder. -Please note that all the above operations **must** be restarted **on the corresponding BE to take effect after they are done on the BE machine. +Please note that all the above operations **must** be restarted on the corresponding BE to take effect after they are done on the BE machine. ## Extended Reading --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org