[doc] Update Module.md (escaping)

fixes #546
This commit is contained in:
Tobias Witek 2020-02-12 21:17:29 +01:00
parent b9cdb0e12a
commit 59663e9d1c
2 changed files with 18 additions and 15 deletions

View file

@ -45,7 +45,10 @@ class print_usage(argparse.Action):
try:
mod = importlib.import_module("bumblebee.modules.{}".format(m["name"]))
if self._args.list_format == "markdown":
print("|{} |{} |".format(m["name"], mod.__doc__.replace("\n", "<br>")))
doc = mod.__doc__.replace("<", "\<")
doc = doc.replace(">", "\>")
doc = doc.replace("\n", "<br>")
print("|{} |{} |".format(m["name"], doc))
else:
print(textwrap.fill("{}:".format(m["name"]), 80,
initial_indent=self._indent*2, subsequent_indent=self._indent*2))