You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
602 B

(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);