From 29368309ce534b608bd95696835d0a989cf5564d Mon Sep 17 00:00:00 2001 From: mrsdizzie Date: Sun, 24 May 2020 09:01:10 -0400 Subject: [PATCH] Fix images in wiki edit preview (#11546) (#11602) 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 276ea54f3..002a36de9 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 60ce8042c..c2f154911 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1325,7 +1325,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) => {