misc: don't use <p> for comment fields when there are block level tags (#18691)
This commit is contained in:
parent
a29a9d9c0d
commit
91a4409209
|
@ -513,10 +513,12 @@ class CommentField(Field):
|
|||
import wcs.workflows
|
||||
label = wcs.workflows.template_on_html_string(label)
|
||||
|
||||
if '<p' in label:
|
||||
enclosing_tag = 'div'
|
||||
else:
|
||||
enclosing_tag = 'p'
|
||||
enclosing_tag = 'p'
|
||||
for block_level in ('p', 'div', 'ul', 'ol', 'hr'):
|
||||
if '<' + block_level in label:
|
||||
enclosing_tag = 'div'
|
||||
break
|
||||
|
||||
form.widgets.append(HtmlWidget(
|
||||
htmltext('<%s %s>%s</%s>' % (enclosing_tag, class_attribute,
|
||||
label, enclosing_tag))))
|
||||
|
|
Loading…
Reference in New Issue