Skip to content

Commit

Permalink
JI-5476 replace 10 or more consecutive underscores with 9 in task des…
Browse files Browse the repository at this point in the history
…cription (#91)
  • Loading branch information
makmentins authored Mar 7, 2024
1 parent 804bca5 commit e6019e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scripts/h5p-crossword.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ export default class Crossword extends H5P.Question {
* @returns {string} Description.
*/
getDescription() {
const introduction = this.params.taskDescription || Crossword.DEFAULT_DESCRIPTION;
// The below replaceAll makes sure we don't get any unwanted XAPI_PLACEHOLDERs in the description
const introduction = this.params.taskDescription.replaceAll(/_{10,}/gi, '_________') || Crossword.DEFAULT_DESCRIPTION;
const fields = this.content.getXAPIDescription();
return `${introduction}${fields}`;
}
Expand Down

0 comments on commit e6019e2

Please sign in to comment.