Skip to content

Commit 991e2f7

Browse files
committed
Fix display of stars in map.apps 4.14
HTML is now escaped by the updated dgrid for security reasons. Returning { html: ... } is necessary if raw html should be rendered. See also dojo/dojo1-dgrid#1419
1 parent 5e47668 commit 991e2f7

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This project is intended to be integrated as a bundle to the installation of your map.apps manager.
33

44
## Installation Guide
5-
**Requirement: map.apps 4.6.0**
5+
**Requirement: map.apps 4.14**
66

77
Before you add the Bundle to your manager, please configure the user and the topic property in the manifest.json to point to your GitHub account. Topic can be left empty.
88
You will have to add a released bundle.jar/zip as a bundle in your map.apps manager.

src/main/js/bundles/mapapps-github-manager/BundleStore.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import TypeFormat from "ct/util/TypeFormat";
1919
import ct_when from "ct/_when";
2020
import apprt_request from "apprt-request";
2121
import d_array from "dojo/_base/array";
22+
import stringEscape from "apprt-core/string-escape";
2223

2324
export default declare([ComplexMemory], {
2425
jsonp: true,
@@ -29,8 +30,10 @@ export default declare([ComplexMemory], {
2930
// register new formatter at ct/util/TypeFormatter class
3031
TypeFormat["stars"] = function (value) {
3132
// eslint-disable-next-line max-len
32-
const star = '<svg aria-label="stars" class="octicon octicon-star" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path fill="#f1c40f" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"></path></svg>'
33-
return star + " " + value;
33+
const star = '<svg aria-label="stars" class="octicon octicon-star" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path fill="#f1c40f" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74z"></path></svg>';
34+
return {
35+
html: `${star} ${stringEscape(value)}`
36+
};
3437
};
3538

3639
if (TypeFormat["version"]) {

0 commit comments

Comments
 (0)