mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2024-12-22 16:20:04 +00:00
Fix markdown linebreaks and match preview render options with final
This commit is contained in:
parent
46682861d0
commit
3bdff6246f
|
@ -92,7 +92,7 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||||
var targetEl = markdownEditor.querySelector(targetSelector);
|
var targetEl = markdownEditor.querySelector(targetSelector);
|
||||||
|
|
||||||
previewTabEl.addEventListener('click', function () {
|
previewTabEl.addEventListener('click', function () {
|
||||||
targetEl.innerHTML = marked(sourceSelector.value.trim());
|
targetEl.innerHTML = marked(sourceSelector.value.trim(), { sanitize: true, breaks:true });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
<script>
|
<script>
|
||||||
var target = document.getElementById('torrent-description');
|
var target = document.getElementById('torrent-description');
|
||||||
var text = target.innerHTML;
|
var text = target.innerHTML;
|
||||||
var html = marked(text.trim(), { sanitize: true });
|
var html = marked(text.trim(), { sanitize: true, breaks:true });
|
||||||
target.innerHTML = html;
|
target.innerHTML = html;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue