mirror of
https://gitee.com/openharmony/applications_notes
synced 2024-10-07 05:33:37 +00:00
commit
7ea998890e
@ -106,9 +106,11 @@ export struct NoteContent {
|
||||
this.editContentFlag = true
|
||||
}
|
||||
LogUtil.info(TAG, "finish loadurl")
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
})
|
||||
if (this.selectedNoteData) {
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
})
|
||||
}
|
||||
})
|
||||
.zoomAccess(false)
|
||||
.height('70%')
|
||||
|
@ -299,7 +299,13 @@ export default {
|
||||
LogUtil.info(TAG, "noteData.content_text is null or undefined")
|
||||
return imgNameArray
|
||||
}
|
||||
let html = atob(noteData.content_text)
|
||||
let base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/
|
||||
let html = ""
|
||||
if (base64regex.test(noteData.content_text)) {
|
||||
html = atob(noteData.content_text)
|
||||
} else {
|
||||
html = noteData.content_text
|
||||
}
|
||||
if (html == undefined || html == null || html == "") {
|
||||
return imgNameArray
|
||||
}
|
||||
|
@ -120,7 +120,13 @@ export default class MainAbility extends Ability {
|
||||
if (html == undefined || html == null || html == "") {
|
||||
return srcArray
|
||||
}
|
||||
let realHtml = atob(html)
|
||||
let base64regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/
|
||||
let realHtml = ""
|
||||
if (base64regex.test(html)) {
|
||||
realHtml = atob(html)
|
||||
} else {
|
||||
realHtml = html;
|
||||
}
|
||||
let imgReg = /<img[^>]+>/g
|
||||
let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i
|
||||
let imgArray = realHtml.match(imgReg)
|
||||
|
Loading…
Reference in New Issue
Block a user