obsidian-map-view icon indicating copy to clipboard operation
obsidian-map-view copied to clipboard

Any URL parsing rule with invalid regex breaks all geocoding

Open jordanmills opened this issue 1 year ago • 1 comments

There's no input or value validation on the URL parsing rules. Or on other URLs too, I guess, but this is where I found it.

In this case, it breaks the flyover and modal location suggestions though (for inline and frontmatter location command actions). They just don't come up, and there's no indication in the regular GUI to indicate the issue.

The debug log option will put a message like this in the console. I will leave my fat-fingered regex in for posterity.

Uncaught (in promise) SyntaxError: Invalid regular expression: /https:\/\/www.bing.com\/maps\/\?\S+cp=[0-9\.\-]+%7E[0-9\.\-]+)\S*/g: Unmatched ')'
    at RegExp (<anonymous>)
    at UrlConvertor.parseLocationFromUrl (plugin:obsidian-map-view:18159:28)
    at GeoSearcher.eval (plugin:obsidian-map-view:18282:61)
    at Generator.next (<anonymous>)
    at eval (plugin:obsidian-map-view:70:71)
    at new Promise (<anonymous>)
    at __awaiter (plugin:obsidian-map-view:66:12)
    at GeoSearcher.search (plugin:obsidian-map-view:18279:16)
    at LocationSearchDialog.eval (plugin:obsidian-map-view:35664:58)
    at Generator.next (<anonymous>)

jordanmills avatar Jun 04 '24 19:06 jordanmills

Will fix, thank you.

esm7 avatar Jun 08 '24 17:06 esm7