You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dj...@apache.org on 2021/11/13 03:34:07 UTC
[camel-website] 01/08: Util changes: better check for strong in util
This is an automated email from the ASF dual-hosted git repository.
djencks pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit eba7ab4993d409fc0d0db48160d514a0ea7a6b99
Author: David Jencks <dj...@apache.org>
AuthorDate: Tue Nov 2 12:46:31 2021 -0700
Util changes:
better check for strong in util
use inline anchor syntax so table cells can be plain not 'a'
---
util/jsonpath-util.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/util/jsonpath-util.js b/util/jsonpath-util.js
index df51c70..bb5f38e 100644
--- a/util/jsonpath-util.js
+++ b/util/jsonpath-util.js
@@ -32,7 +32,7 @@ module.exports = {
boldLink: (text, idPrefix, suffix = '') => {
const idText = `_${idPrefix}_${text.split('.').join('_')}`
text = suffix ? `*${text}* (${suffix})` : `*${text}*`
- return `[#${idText}]\nxref:#${idText}['',role=anchor]${text}`
+ return `[[${idText}]]\nxref:#${idText}['',role=anchor]${text}`
},
description: (value) => {
@@ -87,7 +87,7 @@ module.exports = {
},
strong: (data, text) => {
- return data[text.toLowerCase()] ? `*${text}* ` : ''
+ return trueEnough(data[text.toLowerCase()]) ? `*${text}* ` : ''
},
valueAsString: (value) => {
@@ -95,6 +95,10 @@ module.exports = {
},
}
+function trueEnough (value) {
+ return (value === true) || (value === 'true')
+}
+
function splitOnce (querySpec, token = '=') {
const index = querySpec.indexOf(token)
const pattern = querySpec.substring(0, index).trim()