diff --git a/nyaa/forms.py b/nyaa/forms.py index ba0ad60..334031f 100644 --- a/nyaa/forms.py +++ b/nyaa/forms.py @@ -168,7 +168,7 @@ class EditForm(FlaskForm): information = StringField('Information', [ Length(max=255, message='Information must be at most %(max)d characters long.') ]) - description = TextAreaField('Description (markdown supported)', [ + description = TextAreaField('Description', [ Length(max=10 * 1024, message='Description must be at most %(max)d characters long.') ]) @@ -222,7 +222,7 @@ class UploadForm(FlaskForm): information = StringField('Information', [ Length(max=255, message='Information must be at most %(max)d characters long.') ]) - description = TextAreaField('Description (markdown supported)', [ + description = TextAreaField('Description', [ Length(max=10 * 1024, message='Description must be at most %(max)d characters long.') ]) diff --git a/nyaa/static/js/main.js b/nyaa/static/js/main.js index 9fd1a5d..7f6c48e 100644 --- a/nyaa/static/js/main.js +++ b/nyaa/static/js/main.js @@ -145,28 +145,46 @@ document.addEventListener("DOMContentLoaded", function(event) { } }); +var markdownOptions = { + html : false, + breaks : true, + typographer: true +} +var markdown = window.markdownit(markdownOptions); +markdown.renderer.rules.table_open = function (tokens, idx) { + // Format tables nicer (bootstrap). Force auto-width (default is 100%) + return '