diff --git a/folium/map.py b/folium/map.py index d07699320..5dfab8744 100644 --- a/folium/map.py +++ b/folium/map.py @@ -8,7 +8,7 @@ from branca.element import Element, Figure, Html, MacroElement -from folium.utilities import camelize, parse_options, validate_location +from folium.utilities import camelize, parse_options, validate_location, escape_backticks from jinja2 import Template @@ -362,8 +362,7 @@ def __init__(self, html=None, parse_html=False, max_width='100%', if isinstance(html, Element): self.html.add_child(html) elif isinstance(html, str): - # escape backticks because we use those in the JS template - html = re.sub(r"(?back\\`tick`)[0]; + var {html_name} = $(`