encode to base64 before setting as attirbute to fix descriptions containing quotes

This commit is contained in:
dcore94 2023-12-13 18:29:44 +01:00
parent f57057e307
commit 45ab5dccca
3 changed files with 4 additions and 4 deletions

View File

@ -341,7 +341,7 @@ class CCPExecutionForm extends HTMLElement{
"in" : (e,d)=>{ return Object.values(d.inputs) },
target : "div",
apply : (e,d)=>{
e.innerHTML = `<d4s-ccp-input name="${d.id}" input='${JSON.stringify(d)}'></d4s-ccp-input>`
e.innerHTML = `<d4s-ccp-input name="${d.id}" input='${btoa(JSON.stringify(d))}'></d4s-ccp-input>`
}
}
]
@ -354,7 +354,7 @@ class CCPExecutionForm extends HTMLElement{
"in" : (e,d)=>{ return Object.values(d.outputs) },
target : "div",
apply : (e,d)=>{
e.innerHTML = `<d4s-ccp-output name="${d.id}" output='${JSON.stringify(d)}'></d4s-ccp-output>`
e.innerHTML = `<d4s-ccp-output name="${d.id}" output='${btoa(JSON.stringify(d))}'></d4s-ccp-output>`
}
}
]

View File

@ -7,7 +7,7 @@ class CCPInputWidgetController extends HTMLElement {
}
connectedCallback(){
this.#data = JSON.parse(this.getAttribute("input"))
this.#data = JSON.parse(atob(this.getAttribute("input")))
if(this.isChecklist()){

View File

@ -4,7 +4,7 @@ class CCPOutputWidgetController extends HTMLElement {
constructor(){
super()
this.#output = JSON.parse(this.getAttribute("output"))
this.#output = JSON.parse(atob(this.getAttribute("output")))
}
connectedCallback(){