fix rendering image title in share renderer, closes #4578

This commit is contained in:
zadam 2024-01-09 23:38:44 +01:00
parent 77800d073f
commit 390ad6d813
2 changed files with 6 additions and 2 deletions

View File

@ -137,7 +137,7 @@ function renderCode(result) {
function renderMermaid(result, note) {
result.content = `
<img src="api/images/${note.noteId}/${note.escapedTitle}?${note.utcDateModified}">
<img src="api/images/${note.noteId}/${note.encodedTitle}?${note.utcDateModified}">
<hr>
<details>
<summary>Chart source</summary>
@ -146,7 +146,7 @@ function renderMermaid(result, note) {
}
function renderImage(result, note) {
result.content = `<img src="api/images/${note.noteId}/${note.escapedTitle}?${note.utcDateModified}">`;
result.content = `<img src="api/images/${note.noteId}/${note.encodedTitle}?${note.utcDateModified}">`;
}
function renderFile(note, result) {

View File

@ -490,6 +490,10 @@ class SNote extends AbstractShacaEntity {
return escape(this.title);
}
get encodedTitle() {
return encodeURIComponent(this.title);
}
getPojo() {
return {
noteId: this.noteId,