From cab8a76ae3726bf71ef657dc2e11c0ad41c9ed70 Mon Sep 17 00:00:00 2001 From: Kevin Harwell <kharwell@digium.com> Date: Mon, 25 Feb 2019 15:32:27 -0600 Subject: [PATCH] rest-api-templates/asterisk_processor - replace http line breaks with line feed Including line breaks (<br>, <br/>, <br />) in certain parts of the rest-api json definition (e.g. summary, notes) displays them correctly in swagger. However, when the field gets converted to the wiki format those breaks get escaped and show up in the text as the actual string literal "<br>" etc... This patch makes it so when converting to the wiki format it replaces all line break values (<br>, etc...) with line feeds ('\n'). Change-Id: Ie1c9faa0d1c5d622804cc0a21ce769095b08aa3d --- rest-api-templates/asterisk_processor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest-api-templates/asterisk_processor.py b/rest-api-templates/asterisk_processor.py index 5f8dbb576b..de4732c606 100644 --- a/rest-api-templates/asterisk_processor.py +++ b/rest-api-templates/asterisk_processor.py @@ -46,6 +46,8 @@ def wikify(str): @param str: String to escape """ + # Replace all line breaks with line feeds + str = re.sub(r'<br\s*/?>', '\n', str) return re.sub(r'([{}\[\]])', r'\\\1', str) -- GitLab