@redpanda-data/docs-extensions-and-macros 5.37.4 → 5.37.5
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
|
@@ -68,10 +68,16 @@ function previewString (options) {
|
|
|
68
68
|
|
|
69
69
|
function previewProperty (repo, name, overridesPath, log) {
|
|
70
70
|
const properties = require('../lint-strings/surfaces/properties')
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
|
|
71
|
+
// The generator registers its helpers on whichever handlebars its own
|
|
72
|
+
// require resolves to, and tools/property-extractor/node_modules can hold
|
|
73
|
+
// a second copy - a different instance from this module's, leaving every
|
|
74
|
+
// helper unregistered here. Register them explicitly on an isolated
|
|
75
|
+
// environment instead of relying on that side effect.
|
|
76
|
+
const handlebars = require('handlebars').create()
|
|
77
|
+
const propertyHelpers = require('../property-extractor/helpers')
|
|
78
|
+
for (const [helperName, fn] of Object.entries(propertyHelpers)) {
|
|
79
|
+
handlebars.registerHelper(helperName, fn)
|
|
80
|
+
}
|
|
75
81
|
|
|
76
82
|
const json = properties.runExtractor(repo, log)
|
|
77
83
|
const prop = (json.properties || {})[name]
|