This function mimics the behaviour of underscore js unescape function The html unescape by jinja is not compatible for underscore escape function :param text: input html text :return: unescaped text
(text)
| 50 | |
| 51 | |
| 52 | def underscore_unescape(text): |
| 53 | """ |
| 54 | This function mimics the behaviour of underscore js unescape function |
| 55 | The html unescape by jinja is not compatible for underscore escape |
| 56 | function |
| 57 | :param text: input html text |
| 58 | :return: unescaped text |
| 59 | """ |
| 60 | html_map = { |
| 61 | "&": '&', |
| 62 | "<": '<', |
| 63 | ">": '>', |
| 64 | """: '"', |
| 65 | "'": "'" |
| 66 | } |
| 67 | |
| 68 | # always replace & first |
| 69 | if text: |
| 70 | for c, r in html_map.items(): |
| 71 | text = text.replace(c, r) |
| 72 | |
| 73 | return text |
| 74 | |
| 75 | |
| 76 | def is_version_in_range(sversion, min_ver, max_ver): |
no outgoing calls
no test coverage detected