Proper escaping of annotations

This commit is contained in:
Jackson Harper
2023-05-30 11:09:45 +08:00
parent ffd7bcf568
commit a4e6b00d05

View File

@ -319,7 +319,11 @@ class WebReaderViewModel @Inject constructor(
}
fun saveAnnotation(annotation: String) {
val script = "var event = new Event('saveAnnotation');event.annotation = '$annotation';document.dispatchEvent(event);"
val jsonAnnotation = Gson().toJson(annotation)
val script = "var event = new Event('saveAnnotation');event.annotation = $jsonAnnotation;document.dispatchEvent(event);"
Log.d("loggo", script)
enqueueScript(script)
cancelAnnotationEdit()
}