Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(apostrophe): fixes issue with apostrophe breaking config #2681

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading