diff --git a/css/base.css b/css/base.css index 77f0bfd..6387962 100644 --- a/css/base.css +++ b/css/base.css @@ -9,6 +9,11 @@ background-color: transparent; z-index: 16777271!important; position: absolute!important; + word-wrap: break-word; +} + +.survol-container h1 { + line-height: 24px; } .survol-tooltiptext-youtube { diff --git a/css/templates/wikipedia.css b/css/templates/wikipedia.css index 7a797ec..cd9562b 100644 --- a/css/templates/wikipedia.css +++ b/css/templates/wikipedia.css @@ -41,12 +41,13 @@ font-style: bold; font-size: 24px; margin-bottom: 12px; + line-height: 24px; } .survol-wikipedia-text p, .survol-wikipedia-text h1 { margin: 8px; color: rgb(0, 0, 0)!important; - text-align: justify!important; - text-justify: auto!important; + text-align: left!important; + /* text-justify: auto!important;*/ } \ No newline at end of file diff --git a/js/templates/wikipedia.js b/js/templates/wikipedia.js index ba883df..fd58b7d 100644 --- a/js/templates/wikipedia.js +++ b/js/templates/wikipedia.js @@ -22,6 +22,11 @@ class WikipediaHover { } } + stripHTML(html) { + let doc = new DOMParser().parseFromString(html, 'text/html'); + return doc.body.textContent || ''; + } + bindToContainer(node, domain, container) { if (this.linkType == 'article') { @@ -47,7 +52,7 @@ class WikipediaHover { } let title = document.createElement('h1'); - title.appendChild(document.createTextNode(res.data.displaytitle)); + title.appendChild(document.createTextNode(this.stripHTML(res.data.displaytitle))); let textContainer = document.createElement('div'); textContainer.className = 'survol-wikipedia-text';