Skip to content

Commit

Permalink
Merge pull request #98 from rzhekova/fix-content-width
Browse files Browse the repository at this point in the history
add word wrap fix to entire container (#97)
  • Loading branch information
mdolr authored Oct 9, 2020
2 parents 97e7b93 + e365b5b commit 8536b04
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions css/templates/wikipedia.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;*/
}
7 changes: 6 additions & 1 deletion js/templates/wikipedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {

Expand All @@ -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';
Expand Down

0 comments on commit 8536b04

Please sign in to comment.