Merge pull request #1923 from umap-project/white-space-description

fix: also use white-space: pre-line on map description
This commit is contained in:
Yohan Boniface 2024-06-21 16:37:43 +02:00 committed by GitHub
commit 5e480627cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View file

@ -778,6 +778,11 @@ input[type=hidden].blur + [type="button"] {
/* Various */ /* Various */
/* *********** */ /* *********** */
.text {
word-break: break-word;
white-space: pre-line;
}
.umap-dragover:before { .umap-dragover:before {
content: ' '; content: ' ';
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="arcs">%3Cpath d="M3 15v4c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-4M17 9l-5 5-5-5M12 12.8V2.5"/>%3C/svg>'); background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="arcs">%3Cpath d="M3 15v4c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2v-4M17 9l-5 5-5-5M12 12.8V2.5"/>%3C/svg>');

View file

@ -24,7 +24,7 @@ export default class Caption {
if (this.map.options.description) { if (this.map.options.description) {
const description = DomUtil.element({ const description = DomUtil.element({
tagName: 'div', tagName: 'div',
className: 'umap-map-description', className: 'umap-map-description text',
safeHTML: Utils.toHTML(this.map.options.description), safeHTML: Utils.toHTML(this.map.options.description),
parent: container, parent: container,
}) })

View file

@ -107,7 +107,7 @@ U.PopupTemplate.Default = L.Class.extend({
renderBody: function () { renderBody: function () {
const template = this.feature.getOption('popupContentTemplate') const template = this.feature.getOption('popupContentTemplate')
const target = this.feature.getOption('outlinkTarget') const target = this.feature.getOption('outlinkTarget')
const container = L.DomUtil.create('div', 'umap-popup-container') const container = L.DomUtil.create('div', 'umap-popup-container text')
let content = '' let content = ''
let properties let properties
let center let center

View file

@ -1559,8 +1559,6 @@ span.popup-icon {
} }
.umap-popup-container { .umap-popup-container {
flex-grow: 1; flex-grow: 1;
word-break: break-word;
white-space: pre-line;
margin-bottom: 10px; margin-bottom: 10px;
} }
.umap-popup-container ul { .umap-popup-container ul {