Skip to content

Commit 7504336

Browse files
committed
fix #56
1 parent 79d70e8 commit 7504336

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

src/Demo/vue/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"@mdi/font": "^3.6.95",
1313
"core-js": "^2.6.5",
14-
"poplar-annotation": "^2.0.2",
14+
"poplar-annotation": "^2.0.3",
1515
"prismjs": "^1.17.1",
1616
"roboto-fontface": "*",
1717
"vue": "^2.6.10",

src/Demo/vue/demo/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5678,10 +5678,10 @@ pkg-up@^2.0.0:
56785678
dependencies:
56795679
find-up "^2.1.0"
56805680

5681-
poplar-annotation@^2.0.2:
5682-
version "2.0.2"
5683-
resolved "https://registry.npmjs.org/poplar-annotation/-/poplar-annotation-2.0.2.tgz#5313b7de98da70dcf6a8f9c9cd6514328a0e0325"
5684-
integrity sha512-6hJXqiQv4QO2zbNcuDyF/v1IHKRAuZRjt1ZuYhglz/XJtkkR++dzebMbcLDHlGn29sYsBavkwfCZNc7/DhSfcg==
5681+
poplar-annotation@^2.0.3:
5682+
version "2.0.3"
5683+
resolved "https://registry.npmjs.org/poplar-annotation/-/poplar-annotation-2.0.3.tgz#ae7d19fc155f09b07796c221a3af3602ceff0459"
5684+
integrity sha512-YX+WNjLL0XPY/3Be48+SN/bmerdOG5YurMmo3E3M1qLtWQwEcSqTKh5Cqzdq+PUMJsjHrMni38jW1y2anqKsFw==
56855685
dependencies:
56865686
events "^3.0.0"
56875687

src/Develop/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
.poplar-annotation-content {
1313
font-size: 20px;
14+
font-family: monospace;
1415
}
1516

1617
.poplar-annotation-label {

src/Develop/test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"content": "测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本 测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本 测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本测试文本",
2+
"content": "The aim of the presented study was to characterize the anticonvulsant effects of levetiracetam in combination with various antiepileptic drugs (carbamazepine, phenytoin, topiramate and vigabatrin) in the mouse 6Hz psychomotor seizure model. Limbic (psychomotor) seizure activity was evoked in albino Swiss mice by a current (32mA, 6Hz, 3s stimulus duration) delivered via ocular electrodes; type II isobolographic analysis was used to characterize the consequent anticonvulsant interactions between the various drug combinations for fixed-ratios of 1:1, 1:2, 1:5 and 1:10. With type II isobolographic analysis, the combinations of levetiracetam with carbamazepine and phenytoin for the fixed-ratios of 1:5 and 1:10 were supra-additive (synergistic; P<0.01) in terms of seizure suppression, while the combinations for the fixed-ratios of 1:1 and 1:2 were additive. Levetiracetam combined with topiramate and vigabatrin for the fixed-ratio of 1:10 exerted supra-additive interaction (P<0.05), and simultaneously, the two-drug combinations for the fixed-ratios of 1:1, 1:2 and 1:5 produced additive interaction in the mouse 6Hz psychomotor seizure model. The combinations of levetiracetam with carbamazepine and phenytoin for the fixed-ratios of 1:5 and 1:10, as well as the combinations of levetiracetam with topiramate and vigabatrin for the fixed-ratio of 1:10 appear to be particularly favorable combinations exerting supra-additive interaction in the mouse 6Hz psychomotor seizure model. Finally, it may be concluded that because of the synergistic interactions between levetiracetam and carbamazepine, phenytoin, topiramate and vigabatrin, the combinations might be useful in clinical practice.",
33
"labelCategories": [
44
{
55
"id": 0,

src/View/Entities/ConnectionView/ConnectionCategoryElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export namespace ConnectionCategoryElement {
2626
const textElement =
2727
document.createElementNS(SVGNS, 'text') as SVGTextElement;
2828
textElement.classList.add(...classes);
29-
textElement.innerHTML = store.text;
29+
textElement.textContent = store.text;
3030
textElement.setAttribute('dy', `${font.topToBaseLine}px`);
3131
this.svgElement.appendChild(rectElement);
3232
this.svgElement.appendChild(textElement);

src/View/Entities/LabelView/LabelCategoryElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export namespace LabelCategoryElement {
2828
const textElement = document.createElementNS(SVGNS, 'text') as SVGTextElement;
2929
textElement.style.userSelect = "none";
3030
textElement.style.cursor = "pointer";
31-
textElement.innerHTML = store.text;
31+
textElement.textContent = store.text;
3232
textElement.setAttribute("dx", padding.toString());
3333
textElement.setAttribute("dy", `${font.topToBaseLine + padding}px`);
3434
this.svgElement.appendChild(rectElement);

src/View/Entities/Line/Line.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ export namespace Line {
9090
// and replace it back when export to .svg file
9191
// (and safari is very slow rendering large amount of svg)
9292
// bad for safari!
93-
this.svgElement.innerHTML = this.content.replace(/ /g, "&nbsp;");
93+
this.svgElement.innerHTML = this.content.replace(/ /g, "&nbsp;")
94+
.replace(/</g, "&lt;")
95+
.replace(/>/g, "&gt;");
9496
if (this.isBlank) {
9597
this.svgElement.style.fontSize = `${this.view.contentFont.fontSize / 4}px`;
9698
}

src/View/Font.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export namespace Font {
4949
const characterSet = new Set(characters);
5050
characterSet.delete('\n');
5151
const characterArray = Array.from(characterSet);
52-
testRenderElement.innerHTML = characterArray.join('');
52+
testRenderElement.textContent = characterArray.join('');
5353
testRenderElement.parentNode!.parentNode!.insertBefore(baseLineReferenceElement, testRenderElement.parentNode);
5454
characterArray.forEach((ch: string, index: number) => {
5555
width.set(ch, testRenderElement.getExtentOfChar(index).width);
@@ -118,7 +118,7 @@ export namespace Font {
118118
if (characterArray.length > 0) {
119119
const testRenderElement = document.createElementNS(SVGNS, 'tspan');
120120
testRenderElement.classList.add(...classes);
121-
testRenderElement.innerHTML = characterArray.join('');
121+
testRenderElement.textContent = characterArray.join('');
122122
textElement.appendChild(testRenderElement);
123123
characterArray.forEach((ch: string, index: number) => {
124124
font.width.set(ch, testRenderElement.getExtentOfChar(index).width);

0 commit comments

Comments
 (0)