@pointsharp/antora-llm-generator 1.1.3 → 1.1.4
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/llm-generator.js +3 -8
- package/package.json +1 -1
package/llm-generator.js
CHANGED
|
@@ -240,15 +240,10 @@ function buildSectionsFromNavigatorData(navDataFile, siteUrl, pagesByPath, logge
|
|
|
240
240
|
return componentSections;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
//
|
|
243
|
+
// Evaluate JavaScript object notation safely using Function constructor
|
|
244
244
|
// The navigator extension outputs JavaScript (unquoted keys), not JSON
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
jsData = jsData.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*:)/g, '$1"$2"$3');
|
|
248
|
-
// Convert single quotes to double quotes for string values
|
|
249
|
-
jsData = jsData.replace(/'([^']*)'/g, '"$1"');
|
|
250
|
-
|
|
251
|
-
const siteNavigationData = JSON.parse(jsData);
|
|
245
|
+
// We can't use simple regex to convert because of complex nested HTML strings
|
|
246
|
+
const siteNavigationData = new Function('return ' + jsonMatch[1])();
|
|
252
247
|
if (debug) logger.info(`Parsed ${siteNavigationData.length} components from navigator data`);
|
|
253
248
|
|
|
254
249
|
// Process each component
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pointsharp/antora-llm-generator",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.4",
|
|
5
5
|
"description": "An Antora extension to generate llms.txt files for LLM consumption following llmstxt.org specification.",
|
|
6
6
|
"main": "llm-generator.js",
|
|
7
7
|
"keywords": [
|