mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-08-11 23:17:19 -04:00
24 lines
580 B
Vue
24 lines
580 B
Vue
<template>
|
|
<span><slot></slot></span>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
mounted() {
|
|
this.removeWhitespaces(this.$el);
|
|
},
|
|
methods: {
|
|
removeWhitespaces(parent) {
|
|
for (const child of parent.childNodes) {
|
|
if (child.nodeName === '#text' && child.textContent.trim() === '') {
|
|
parent.removeChild(child);
|
|
}
|
|
for (const grandchild of child.childNodes) {
|
|
this.removeWhitespaces(grandchild);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|