Skip to content

Commit

Permalink
fix null content issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Dec 8, 2023
1 parent 93f8439 commit 2856e33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions vue-project/src/i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const onClient = typeof document !== 'undefined'

export async function setupI18n(lang){
const cookies = onClient ?await import('vue-cookies') :null
if(!lang){
lang = (await import('vue-cookies')).get(LANG_COOKIE)
if(!lang && cookies){
lang = cookies.get(LANG_COOKIE)
}
if(!lang){
for(let l of window.navigator.languages){
Expand Down
2 changes: 1 addition & 1 deletion vue-project/src/utils/tinyParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const codePatten = /(`+)([^\1]+?)\1/
// })()

export function escapeHtml(content){
return content
return !content ?'' :content
.replaceAll('&', '&')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;')
Expand Down

0 comments on commit 2856e33

Please sign in to comment.