kopia lustrzana https://github.com/micropython/micropython-lib
html: Use translate function from MicroPython string module.
rodzic
d8239aa6da
commit
c8022030e4
|
@ -16,6 +16,7 @@ def escape(s, quote=True):
|
||||||
characters, both double quote (") and single quote (') characters are also
|
characters, both double quote (") and single quote (') characters are also
|
||||||
translated.
|
translated.
|
||||||
"""
|
"""
|
||||||
|
import string
|
||||||
if quote:
|
if quote:
|
||||||
return s.translate(_escape_map_full)
|
return string.translate(s, _escape_map_full)
|
||||||
return s.translate(_escape_map)
|
return string.translate(s, _escape_map)
|
||||||
|
|
Ładowanie…
Reference in New Issue