2 changed files with 20 additions and 0 deletions
@ -0,0 +1,19 @@
|
||||
(function (Drupal, once) { |
||||
Drupal.behaviors.fixMiradorAnnotationSpaces = { |
||||
attach: function (context, settings) { |
||||
// Find all Mirador annotation HTML content wrappers
|
||||
const annotationElements = once( |
||||
"fix-annotation-spaces", |
||||
".mirador-third-party-html", |
||||
context |
||||
); |
||||
|
||||
annotationElements.forEach((el) => { |
||||
// Replace both the literal ' ' string and the non-breaking space character (\u00A0)
|
||||
el.innerHTML = el.innerHTML |
||||
.replace(/ /g, " ") |
||||
.replace(/\u00A0/g, " "); |
||||
}); |
||||
}, |
||||
}; |
||||
})(Drupal, once); |
||||
Loading…
Reference in new issue