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
This commit is contained in:
mrsdizzie authored and GitHub committed 2020-05-24 11:41:33 +01:00
1 parent 814ca9ffea
commit ae55dc7a6b
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -1323,7 +1323,8 @@ function initWikiForm() {
_csrf: csrf,
mode: 'gfm',
context: $editArea.data('context'),
text: plainText
text: plainText,
wiki: true
}, (data) => {
preview.innerHTML = `<div class="markdown ui segment">${data}</div>`;
$(preview).find('pre code').each((_, e) => {