Skip to content

Commit 803c7e2

Browse files
committed
Build with html injection fix
1 parent 291d955 commit 803c7e2

File tree

1 file changed

+29
-24
lines changed

1 file changed

+29
-24
lines changed

build/jsroot.js

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const version_id = '7.8.x',
1212

1313
/** @summary version date
1414
* @desc Release date in format day/month/year like '14/04/2022' */
15-
version_date = '9/04/2025',
15+
version_date = '21/10/2025',
1616

1717
/** @summary version id and date
1818
* @desc Produced by concatenation of {@link version_id} and {@link version_date}
@@ -13784,23 +13784,24 @@ function drawRawText(dom, txt /* , opt */) {
1378413784
let txt = (this.txt._typename === clTObjString) ? this.txt.fString : this.txt.value;
1378513785
if (!isStr(txt)) txt = '<undefined>';
1378613786

13787-
const mathjax = this.txt.mathjax || (settings.Latex === constants$1.Latex.AlwaysMathJax);
13788-
13789-
if (!mathjax && !('as_is' in this.txt)) {
13790-
const arr = txt.split('\n'); txt = '';
13791-
for (let i = 0; i < arr.length; ++i)
13792-
txt += `<pre style='margin:0'>${arr[i]}</pre>`;
13793-
}
13794-
13795-
const frame = this.selectDom();
13787+
const mathjax = this.txt.mathjax || (settings.Latex === constants$1.Latex.AlwaysMathJax),
13788+
frame = this.selectDom();
1379613789
let main = frame.select('div');
1379713790
if (main.empty())
1379813791
main = frame.append('div').attr('style', 'max-width:100%;max-height:100%;overflow:auto');
13799-
main.html(txt);
13792+
else
13793+
main.html('');
1380013794

1380113795
// (re) set painter to first child element, base painter not requires canvas
1380213796
this.setTopPainter();
1380313797

13798+
if (!mathjax && !('as_is' in this.txt)) {
13799+
const arr = txt.split('\n');
13800+
for (let i = 0; i < arr.length; ++i)
13801+
main.append('pre').style('margin', '0').text(arr[i]);
13802+
} else
13803+
main.text(txt);
13804+
1380413805
if (mathjax)
1380513806
typesetMathjax(frame.node());
1380613807

@@ -62089,7 +62090,7 @@ class StandaloneMenu extends JSRootMenu {
6208962090
text.style.display = 'flex';
6209062091

6209162092
const chk = doc.createElement('span');
62092-
chk.innerHTML = d.checked ? '\u2713' : '';
62093+
chk.innerText = d.checked ? '\u2713' : '';
6209362094
chk.style.display = 'inline-block';
6209462095
chk.style.width = '1em';
6209562096
text.appendChild(chk);
@@ -62102,7 +62103,7 @@ class StandaloneMenu extends JSRootMenu {
6210262103
} else {
6210362104
if (need_check_area) {
6210462105
const chk = doc.createElement('span');
62105-
chk.innerHTML = d.checked ? '\u2713' : '';
62106+
chk.innerText = d.checked ? '\u2713' : '';
6210662107
chk.style.display = 'inline-block';
6210762108
chk.style.width = '1em';
6210862109
text.appendChild(chk);
@@ -66684,7 +66685,7 @@ class TFramePainter extends ObjectPainter {
6668466685
changed = true;
6668566686
zoom_z = false;
6668666687
if (interactive)
66687-
this.zoomChangedInteractive('y', interactive);
66688+
this.zoomChangedInteractive('z', interactive);
6668866689
}
6668966690
});
6669066691
}
@@ -67831,10 +67832,12 @@ class FlexibleDisplay extends MDIDisplay {
6783167832
main = top.append('div');
6783267833

6783367834
main.html('<div class=\'jsroot_flex_header\' style=\'height: 23px; overflow: hidden; background-color: lightblue\'>' +
67834-
`<p style='margin: 1px; float: left; font-size: 14px; padding-left: 5px'>${title}</p></div>`+
67835-
`<div id='${this.frameid}_cont${this.cnt}' class='jsroot_flex_draw' style='overflow: hidden; width: 100%; height: calc(100% - 24px); background: white'></div>`+
67835+
'<p style=\'margin: 1px; float: left; font-size: 14px; padding-left: 5px\'></p></div>' +
67836+
`<div id='${this.frameid}_cont${this.cnt}' class='jsroot_flex_draw' style='overflow: hidden; width: 100%; height: calc(100% - 24px); background: white'></div>` +
6783667837
'<div class=\'jsroot_flex_resize\' style=\'position: absolute; right: 3px; bottom: 1px; overflow: hidden; cursor: nwse-resize\'>&#x25FF;</div>');
6783767838

67839+
main.select('.jsroot_flex_header p').text(title);
67840+
6783867841
main.attr('class', 'jsroot_flex_frame')
6783967842
.style('position', 'absolute')
6784067843
.style('left', Math.round(w * (this.cnt % 5)/10) + 'px')
@@ -102520,7 +102523,7 @@ class TDrawSelector extends TSelector {
102520102523
res.k = res.nbins / (res.max - res.min);
102521102524

102522102525
res.GetBin = function(value) {
102523-
const bin = this.lbls?.indexOf(value) ?? Number.isFinite(value) ? Math.floor((value - this.min) * this.k) : this.nbins + 1;
102526+
const bin = this.lbls?.indexOf(value) ?? (Number.isFinite(value) ? Math.floor((value - this.min) * this.k) : this.nbins + 1);
102524102527
return bin < 0 ? 0 : ((bin > this.nbins) ? this.nbins + 1 : bin + 1);
102525102528
};
102526102529

@@ -103049,7 +103052,7 @@ async function treeProcess(tree, selector, args) {
103049103052
default: return null;
103050103053
}
103051103054
const elem = createStreamerElement(name || leaf.fName, datakind);
103052-
if (leaf.fLen > 1) {
103055+
if ((leaf.fLen > 1) && (datakind !== kTString)) {
103053103056
elem.fType += kOffsetL;
103054103057
elem.fArrayLength = leaf.fLen;
103055103058
}
@@ -143508,7 +143511,7 @@ function objectHierarchy(top, obj, args = undefined) {
143508143511
item._vclass = 'h_value_num';
143509143512
} else if (isStr(fld)) {
143510143513
simple = true;
143511-
item._value = '&quot;' + fld.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;') + '&quot;';
143514+
item._value = '"' + fld + '"';
143512143515
item._vclass = 'h_value_str';
143513143516
} else if (typeof fld === 'undefined') {
143514143517
simple = true;
@@ -144272,8 +144275,10 @@ class HierarchyPainter extends BasePainter {
144272144275

144273144276
if ('_value' in hitem) {
144274144277
const d3p = d3line.append('p');
144275-
if ('_vclass' in hitem) d3p.attr('class', hitem._vclass);
144276-
if (!hitem._isopen) d3p.html(hitem._value);
144278+
if ('_vclass' in hitem)
144279+
d3p.attr('class', hitem._vclass);
144280+
if (!hitem._isopen)
144281+
d3p.text(hitem._value);
144277144282
}
144278144283

144279144284
if (has_childs && (isroot || hitem._isopen)) {
@@ -146825,7 +146830,7 @@ class HierarchyPainter extends BasePainter {
146825146830
const layout = main.select('.gui_layout');
146826146831
if (!layout.empty()) {
146827146832
['simple', 'vert2', 'vert3', 'vert231', 'horiz2', 'horiz32', 'flex', 'tabs',
146828-
'grid 2x2', 'grid 1x3', 'grid 2x3', 'grid 3x3', 'grid 4x4'].forEach(kind => layout.append('option').attr('value', kind).html(kind));
146833+
'grid 2x2', 'grid 1x3', 'grid 2x3', 'grid 3x3', 'grid 4x4'].forEach(kind => layout.append('option').attr('value', kind).text(kind));
146829146834

146830146835
layout.on('change', ev => {
146831146836
const kind = ev.target.value || 'flex';
@@ -146865,7 +146870,7 @@ class HierarchyPainter extends BasePainter {
146865146870
}
146866146871
if (!found) {
146867146872
const opt = document.createElement('option');
146868-
opt.innerHTML = opt.value = this.getLayout();
146873+
opt.innerText = opt.value = this.getLayout();
146869146874
selects.appendChild(opt);
146870146875
selects.selectedIndex = selects.options.length - 1;
146871146876
}
@@ -156143,7 +156148,7 @@ class TASImagePainter extends ObjectPainter {
156143156148
pal_painter = p;
156144156149

156145156150
// mark painter as secondary - not in list of TCanvas primitives
156146-
pal_painter.setSecondary(this);
156151+
pal_painter.setSecondaryId(this);
156147156152

156148156153
// make dummy redraw, palette will be updated only from histogram painter
156149156154
pal_painter.redraw = function() {};

0 commit comments

Comments
 (0)