1
0
Fork 0
mirror of https://gitlab.com/SIGBUS/nyaa.git synced 2024-12-22 16:40:00 +00:00

Fix markdown linebreaks and match preview render options with final

This commit is contained in:
TheAMM 2017-05-14 09:38:19 +03:00
parent 46682861d0
commit 3bdff6246f
2 changed files with 2 additions and 2 deletions

View file

@ -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 });
}); });
}); });
}); });

View file

@ -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>