@redpanda-data/docs-extensions-and-macros 5.47.0 → 5.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -93,10 +93,16 @@ function ensureHeadingSeparation (body) {
|
|
|
93
93
|
* Single-backtick spans still apply attribute substitution, so spans are
|
|
94
94
|
* escaped too; `----` listing blocks and ```/~~~ fences are verbatim and stay
|
|
95
95
|
* untouched (a `\{` inside a fence would render as a literal backslash).
|
|
96
|
+
*
|
|
97
|
+
* The name may start uppercase or with an underscore, because environment
|
|
98
|
+
* variable placeholders are the common case in prose: Asciidoctor downcases
|
|
99
|
+
* a reference before looking it up, so ${SALESFORCE_CLIENT_SECRET} outside a
|
|
100
|
+
* fence is consumed exactly like a lowercase one and logs the missing
|
|
101
|
+
* attribute as salesforce_client_secret.
|
|
96
102
|
*/
|
|
97
103
|
function escapePlaceholderBraces (body) {
|
|
98
104
|
return annotateVerbatimLines(body).map(({ line, verbatim }) => (
|
|
99
|
-
verbatim ? line : line.replace(/(?<![\\{])\{([
|
|
105
|
+
verbatim ? line : line.replace(/(?<![\\{])\{([A-Za-z_][\w.-]{1,30})\}/g, '\\{$1}')
|
|
100
106
|
)).join('\n');
|
|
101
107
|
}
|
|
102
108
|
|
|
@@ -2,6 +2,7 @@ const yaml = require('yaml');
|
|
|
2
2
|
const renderYamlList = require('./renderYamlList');
|
|
3
3
|
const handlebars = require('handlebars');
|
|
4
4
|
const { connectFieldName } = require('./flattenConnectFields');
|
|
5
|
+
const { escapePlaceholderBraces } = require('./renderConnectDescription');
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Renders the children of a configuration object into AsciiDoc.
|
|
@@ -68,7 +69,9 @@ module.exports = function renderConnectFields(children, prefix = '') {
|
|
|
68
69
|
block += `=== \`${currentPath}\`\n\n`;
|
|
69
70
|
|
|
70
71
|
// --- Beta badge logic (now uses is_beta) ---
|
|
71
|
-
|
|
72
|
+
// Escaped before the badge is prepended, not after: the badge's own
|
|
73
|
+
// tooltip={page-beta-text} is a real attribute reference and must survive.
|
|
74
|
+
let desc = escapePlaceholderBraces(child.description || '');
|
|
72
75
|
if (child.is_beta) {
|
|
73
76
|
// Remove any leading "BETA:" label (case-insensitive, trims leading whitespace)
|
|
74
77
|
desc = 'badge::[label=Beta, size=large, tooltip={page-beta-text}]\n\n' + desc.replace(/^\s*BETA:\s*/i, '');
|