You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2022/04/26 16:33:08 UTC
[camel-website] 01/01: Remove all the formatting characters from the id to prevent invalid url generation
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch url-generation-error
in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit abe9d3f7ceebdbcd0c257a61785d5535a24e99ed
Author: Nicolas Filotto <nf...@talend.com>
AuthorDate: Tue Apr 26 18:32:48 2022 +0200
Remove all the formatting characters from the id to prevent invalid url generation
---
util/jsonpath-util.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util/jsonpath-util.js b/util/jsonpath-util.js
index b558324f..38255927 100644
--- a/util/jsonpath-util.js
+++ b/util/jsonpath-util.js
@@ -38,7 +38,8 @@ module.exports = {
},
boldLink: (text, idPrefix, suffix = '') => {
- const idText = `_${idPrefix}_${text.split('.').join('_')}`
+ // Remove all the formatting characters from the id to prevent invalid url generation
+ const idText = `_${idPrefix}_${text.split(/[*_`#~^]*/g).join('').split('.').join('_')}`
text = suffix ? `*${text}* (${suffix})` : `*${text}*`
return `[[${idText}]]\nxref:#${idText}['',role=anchor]${text}`
},