[Asterisk-code-review] rest-api-templates/asterisk processor - replace http line br... (asterisk[13])
Kevin Harwell
asteriskteam at digium.com
Mon Feb 25 15:40:01 CST 2019
Kevin Harwell has uploaded this change for review. ( https://gerrit.asterisk.org/11039
Change subject: rest-api-templates/asterisk_processor - replace http line breaks with line feed
......................................................................
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
---
M rest-api-templates/asterisk_processor.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/39/11039/1
diff --git a/rest-api-templates/asterisk_processor.py b/rest-api-templates/asterisk_processor.py
index 5f8dbb5..c847d5d 100644
--- a/rest-api-templates/asterisk_processor.py
+++ b/rest-api-templates/asterisk_processor.py
@@ -46,6 +46,8 @@
@param str: String to escape
"""
+ str = str.replace('<br />', '\n').replace(
+ '<br/>', '\n').replace('<br>', '\n')
return re.sub(r'([{}\[\]])', r'\\\1', str)
--
To view, visit https://gerrit.asterisk.org/11039
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1c9faa0d1c5d622804cc0a21ce769095b08aa3d
Gerrit-Change-Number: 11039
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190225/b2efe4bb/attachment.html>
More information about the asterisk-code-review
mailing list