Merge pull request #1306 from umap-project/popup-img-width
Use css width for img custom width
This commit is contained in:
commit
a9cd424f05
2 changed files with 2 additions and 2 deletions
|
@ -129,7 +129,7 @@ L.Util.toHTML = (r, options) => {
|
||||||
|
|
||||||
// images
|
// images
|
||||||
r = r.replace(/{{([^\]|]*?)}}/g, '<img src="$1">')
|
r = r.replace(/{{([^\]|]*?)}}/g, '<img src="$1">')
|
||||||
r = r.replace(/{{([^|]*?)\|(\d*?)}}/g, '<img src="$1" width="$2">')
|
r = r.replace(/{{([^|]*?)\|(\d*?)(px)?}}/g, '<img src="$1" style="width:$2px;min-width:$2px;">')
|
||||||
|
|
||||||
//Unescape http
|
//Unescape http
|
||||||
r = r.replace(/(h_t_t_p)/g, 'http')
|
r = r.replace(/(h_t_t_p)/g, 'http')
|
||||||
|
|
|
@ -108,7 +108,7 @@ describe('L.Util', function () {
|
||||||
it('should handle image with width', function () {
|
it('should handle image with width', function () {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
L.Util.toHTML('A simple image: {{http://osm.org/pouet.png|100}}'),
|
L.Util.toHTML('A simple image: {{http://osm.org/pouet.png|100}}'),
|
||||||
'A simple image: <img width="100" src="http://osm.org/pouet.png">'
|
'A simple image: <img style="width:100px;min-width:100px;" src="http://osm.org/pouet.png">'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue