diff --git a/src/components/d-article.js b/src/components/d-article.js index accd247..b612cbf 100644 --- a/src/components/d-article.js +++ b/src/components/d-article.js @@ -13,6 +13,8 @@ const T = Template('d-article', ` // } // } +const isOnlyWhitespace = /^\s*$/; + export class Article extends T(HTMLElement) { constructor() { @@ -21,8 +23,20 @@ export class Article extends T(HTMLElement) { new MutationObserver( (mutations) => { for (const mutation of mutations) { for (const addedNode of mutation.addedNodes) { - if (addedNode.nodeName === 'HR') { + switch (addedNode.nodeName) { + case 'HR': console.warn('Use of
tag. We found the following text: ' + text); + const wrapper = document.createElement('span'); + wrapper.innerHTML = addedNode.nodeValue; + addedNode.parentNode.insertBefore(wrapper, addedNode); + addedNode.parentNode.removeChild(addedNode); + } + } break; } } }