Most appropriate sections of the p5.js website?
Community (Sketches, Libraries, Events)
What is your operating system?
Linux
Web browser and version
Firefox 152.0.4
Actual Behavior
The generated search index appends the literal string "undefined" to the end of every event description across all generated locale search indices (en.json, es.json, hi.json, ko.json, and zh-Hans.json).
This is caused by concatenating content + data.description in src/scripts/builders/search.ts. Event pages do not define a description field, so data.description is undefined, which JavaScript coerces into the literal string "undefined" during string concatenation.
As a result, every generated search index contains incorrect event descriptions.
Expected Behavior
Generated event descriptions should not include the literal string "undefined".
Steps to reproduce
-
Generate the search index:
-
Start the development server:
-
Open the browser DevTools Console and run:
fetch("/search-indices/en.json")
.then(r => r.json())
.then(data => {
const events = Object.values(data.events);
console.log("Total events:", events.length);
console.log(
"Ends with 'undefined':",
events.filter(event => event.description.endsWith("undefined")).length
);
});
-
Observe the output:
Total events: 5
Ends with 'undefined': 5
Alternatively, inspect any of the generated search index files (en.json, es.json, hi.json, ko.json, or zh-Hans.json) and search for:
Every event description ends with the literal string "undefined".
Would you like to work on the issue?
Yes
Most appropriate sections of the p5.js website?
Community (Sketches, Libraries, Events)
What is your operating system?
Linux
Web browser and version
Firefox 152.0.4
Actual Behavior
The generated search index appends the literal string
"undefined"to the end of every event description across all generated locale search indices (en.json,es.json,hi.json,ko.json, andzh-Hans.json).This is caused by concatenating
content + data.descriptioninsrc/scripts/builders/search.ts. Event pages do not define adescriptionfield, sodata.descriptionisundefined, which JavaScript coerces into the literal string"undefined"during string concatenation.As a result, every generated search index contains incorrect event descriptions.
Expected Behavior
Generated event descriptions should not include the literal string
"undefined".Steps to reproduce
Generate the search index:
Start the development server:
Open the browser DevTools Console and run:
Observe the output:
Alternatively, inspect any of the generated search index files (
en.json,es.json,hi.json,ko.json, orzh-Hans.json) and search for:Every event description ends with the literal string
"undefined".Would you like to work on the issue?
Yes