@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redpanda-data/docs-extensions-and-macros",
3
- "version": "5.37.4",
3
+ "version": "5.37.5",
4
4
  "description": "Antora extensions and macros developed for Redpanda documentation.",
5
5
  "keywords": [
6
6
  "antora",
@@ -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
- const handlebars = require('handlebars')
72
- // Requiring the generator registers its Handlebars helpers (eq, ...) as a
73
- // side effect - the same environment a real generation run uses.
74
- require('../property-extractor/generate-handlebars-docs')
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]