Skip to content

Commit

Permalink
fix(apostrophe): fixes issue with apostrophe breaking config (Canadia…
Browse files Browse the repository at this point in the history
  • Loading branch information
DamonU2 authored Jan 10, 2025
1 parent af5b3d4 commit 7606951
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ <h4 id="HMap1">OSDP Integration</h4>
return new Promise (resolve => {
removeMap('Map1')
.then(() => {
cgpv.api.createMapFromConfig('Map1', JSON.stringify(mapConfig).replace(/'/g, "\\'"), 800)
cgpv.api.createMapFromConfig('Map1', JSON.stringify(mapConfig), 800)
.then(() => {
resolve();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/geoview-core/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export async function initMapDivFromFunctionCall(mapDiv: HTMLElement, mapConfig:
// Create a data-config attribute and set config value on the div
const att = document.createAttribute(url ? 'data-config-url' : 'data-config');
// Clean apostrophes in the config
att.value = JSON.stringify(mapConfig).replace(/'/g, "\\'");
att.value = mapConfig.replaceAll("'", "\\'");
mapDiv.setAttributeNode(att);

// Set the geoview-map class on the div so that this class name is standard for all maps (either created via init or via func call)
Expand Down

0 comments on commit 7606951

Please sign in to comment.