From ae55dc7a6ba9c08c4a8e0750acf89f9ad3fabffb Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Sun, 24 May 2020 06:41:33 -0400 Subject: [PATCH] Fix images in wiki edit preview (#11546) Make sure wiki editor sets wiki to true so gitea renders it as a wiki page. Also change the context data attr for edit form. This looks wrong but everywhere else in our code assumes the urlPrefix to be just the repo url when rendering and manually adds /wiki to the rendered url regardless. Fixes #11540 --- templates/repo/wiki/new.tmpl | 2 +- web_src/js/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/repo/wiki/new.tmpl b/templates/repo/wiki/new.tmpl index 276ea54f3a..002a36de96 100644 --- a/templates/repo/wiki/new.tmpl +++ b/templates/repo/wiki/new.tmpl @@ -21,7 +21,7 @@ {{.i18n.Tr "preview"}}
- +
diff --git a/web_src/js/index.js b/web_src/js/index.js index 46b0425014..553948bb36 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1323,7 +1323,8 @@ function initWikiForm() { _csrf: csrf, mode: 'gfm', context: $editArea.data('context'), - text: plainText + text: plainText, + wiki: true }, (data) => { preview.innerHTML = `
${data}
`; $(preview).find('pre code').each((_, e) => {