Skip to content

Commit fbe3d1c

Browse files
Add support for basic HTML formatting
1 parent cf06d77 commit fbe3d1c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

conversion/indico_conversion/plugin.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
from flask import flash, g
1313
from flask_pluginengine import render_plugin_template, uses
14-
from wtforms.fields import BooleanField, EmailField, IntegerField, URLField, TextAreaField
14+
from markupsafe import Markup
15+
from wtforms.fields import BooleanField, EmailField, IntegerField, TextAreaField, URLField
1516
from wtforms.validators import DataRequired, NumberRange, Optional
1617

1718
from indico.core import signals
@@ -59,7 +60,8 @@ class SettingsForm(IndicoForm):
5960
description=_('Email to send the notifications to'))
6061
cloudconvert_conversion_notice = TextAreaField(_('PDF conversion notice'),
6162
description=_('A notice that will be shown to end users when '
62-
'converting PDF files in the upload files dialog.'))
63+
'converting PDF files in the upload files dialog. '
64+
'You may use basic HTML elements for formatting.'))
6365
valid_extensions = TextListField(_('Extensions'),
6466
filters=[lambda exts: sorted({ext.lower().lstrip('.').strip() for ext in exts})],
6567
description=_('File extensions for which PDF conversion is supported. '
@@ -112,11 +114,11 @@ def _add_file_form_fields(self, form_cls, **kwargs):
112114
description = _('If enabled, your files will be converted to PDF if possible. '
113115
'The following file types can be converted: {exts}').format(exts=exts)
114116
if self.settings.get('cloudconvert_conversion_notice'):
115-
description = '{}\n\n{}'.format(self.settings.get('cloudconvert_conversion_notice'),
117+
description = '{}<br>{}'.format(self.settings.get('cloudconvert_conversion_notice'),
116118
_('The following file types can be converted: {exts}').format(exts=exts))
117119
return 'convert_to_pdf', \
118120
BooleanField(_('Convert to PDF'), widget=SwitchWidget(),
119-
description=description,
121+
description=Markup(description),
120122
default=True)
121123

122124
def _add_url_form_fields(self, form_cls, **kwargs):

0 commit comments

Comments
 (0)