Browse Source

annotation spaces

master
rdrew 4 days ago
parent
commit
99a3bccc72
  1. 19
      js/fix-annotation-spaces.js
  2. 1
      oliveskspaces.libraries.yml

19
js/fix-annotation-spaces.js

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

1
oliveskspaces.libraries.yml

@ -57,6 +57,7 @@ global-styling:
js:
js/checkbox.js: {}
js/custom.js: {}
js/fix-annotation-spaces.js: {}
dependencies:
- core/drupal

Loading…
Cancel
Save