docs: Workaround for non-string values (#36720)

* Workaround for non-string values

So I think the proper fix should go into html_ify, which should convert
any value into a string, rather than expecting strings only.

* My preferred solution
pull/36796/head
Dag Wieers 6 years ago committed by John R Barker
parent e75989ec88
commit 50e989f906

@ -48,7 +48,7 @@ from jinja2 import Environment, FileSystemLoader
from six import iteritems, string_types
from ansible.errors import AnsibleError
from ansible.module_utils._text import to_bytes
from ansible.module_utils._text import to_bytes, to_text
from ansible.plugins.loader import fragment_loader
from ansible.utils import plugin_docs
from ansible.utils.display import Display
@ -101,6 +101,9 @@ def rst_ify(text):
def html_ify(text):
''' convert symbols like I(this is in italics) to valid HTML '''
if not isinstance(text, string_types):
text = to_text(text)
t = html_escape(text)
t = _ITALIC.sub(r"<em>\1</em>", t)
t = _BOLD.sub(r"<b>\1</b>", t)

Loading…
Cancel
Save