Skip to content

backslashes in popup break page. #1907

Open
@jrjdavidson

Description

@jrjdavidson

Describe the bug
It seems if a backslash followed by a number is included in the text of a popup, the map will fail to generate. Once the map is generated, if an attempt to load the map is map, no map is displayed and the following error is present in the browser console.

Uncaught SyntaxError: octal escape sequences can't be used in untagged template literals or in strict mode code

In my case, it caught me off guard as I only recently had a path come up that caused the issue. Hope the report helps others..

To Reproduce
( i tried to simplify my code, I didn't actual test this)

html="<div>\\file\Shared\SEESPhotoDatabase\Archive\JD\Cave Rock photos\20190221\101MEDIA</div>"
 m = folium.Map()
 popup = folium.Popup(html)

folium.GeoJson(feature['geometry'],
                           popup=popup).add_to(m)

Expected behavior
Normal map with a pop up.

Environment (please complete the following information):

  • checked in chrome and firefox

Possible solutions
Check all strings and escape any backslashes(\) before adding as a popup

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue describing unexpected or malicious behaviour

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions