diff --git a/umap/static/umap/js/umap.core.js b/umap/static/umap/js/umap.core.js index c27c2bc6..70edfb8f 100644 --- a/umap/static/umap/js/umap.core.js +++ b/umap/static/umap/js/umap.core.js @@ -81,9 +81,9 @@ L.Util.toHTML = function (r) { r = r.replace(/\[\[([^|]*?)\|(.*?)\]\]/g, '$2'); // iframe - r = r.replace(/{{{(h_t_t_ps?[^ |]*)}}}/g, ''); - r = r.replace(/{{{(h_t_t_ps?[^ |]*)\|(\d*)(px)?}}}/g, ''); - r = r.replace(/{{{(h_t_t_ps?[^ |]*)\|(\d*)(px)?\*(\d*)(px)?}}}/g, ''); + r = r.replace(/{{{(h_t_t_ps?[^ |{]*)}}}/g, ''); + r = r.replace(/{{{(h_t_t_ps?[^ |{]*)\|(\d*)(px)?}}}/g, ''); + r = r.replace(/{{{(h_t_t_ps?[^ |{]*)\|(\d*)(px)?\*(\d*)(px)?}}}/g, ''); // images r = r.replace(/{{([^\]|]*?)}}/g, ''); diff --git a/umap/static/umap/test/Util.js b/umap/static/umap/test/Util.js index ea8d6b2d..b6b96c0b 100644 --- a/umap/static/umap/test/Util.js +++ b/umap/static/umap/test/Util.js @@ -94,6 +94,10 @@ describe('L.Util', function () { assert.equal(L.Util.toHTML('A simple iframe: {{{https://osm.org/?url=https%3A//anotherurl.com}}}'), 'A simple iframe: '); }); + it('should handle iframe with height with px', function () { + assert.equal(L.Util.toHTML('A double iframe: {{{https://osm.org/pouet}}}{{{https://osm.org/boudin}}}'), 'A double iframe: '); + }); + it('http link with http link as parameter as variable', function () { assert.equal(L.Util.toHTML('A phrase with a [[http://iframeurl.com?to=http://another.com]].'), 'A phrase with a http://iframeurl.com?to=http://another.com.'); });