mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-20 22:40:39 +08:00
Removed some old front-end md rendering elements
Also ensured revisions were not created more often than expected. Summary field null check was triggering revision save even when empty since it was still in request. Related to #1846
This commit is contained in:
parent
a98fc71720
commit
5323cb5224
@ -190,11 +190,11 @@ class PageRepo
|
||||
$this->getUserDraftQuery($page)->delete();
|
||||
|
||||
// Save a revision after updating
|
||||
$summary = $input['summary'] ?? null;
|
||||
$summary = trim($input['summary'] ?? "");
|
||||
$htmlChanged = isset($input['html']) && $input['html'] !== $oldHtml;
|
||||
$nameChanged = isset($input['name']) && $input['name'] !== $oldName;
|
||||
$markdownChanged = isset($input['markdown']) && $input['markdown'] !== $oldMarkdown;
|
||||
if ($htmlChanged || $nameChanged || $markdownChanged || $summary !== null) {
|
||||
if ($htmlChanged || $nameChanged || $markdownChanged || $summary) {
|
||||
$this->savePageRevision($page, $summary);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ class MarkdownEditor {
|
||||
|
||||
this.displayStylesLoaded = false;
|
||||
this.input = this.elem.querySelector('textarea');
|
||||
this.htmlInput = this.elem.querySelector('input[name=html]');
|
||||
this.cm = code.markdownEditor(this.input);
|
||||
|
||||
this.onMarkdownScroll = this.onMarkdownScroll.bind(this);
|
||||
@ -125,7 +124,6 @@ class MarkdownEditor {
|
||||
// Set body content
|
||||
this.displayDoc.body.className = 'page-content';
|
||||
this.displayDoc.body.innerHTML = html;
|
||||
this.htmlInput.value = html;
|
||||
|
||||
// Copy styles from page head and set custom styles for editor
|
||||
this.loadStylesIntoDisplay();
|
||||
|
@ -35,8 +35,6 @@
|
||||
</div>
|
||||
<iframe src="about:blank" class="markdown-display" sandbox="allow-same-origin"></iframe>
|
||||
</div>
|
||||
<input type="hidden" name="html"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user