Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any URL parsing rule with invalid regex breaks all geocoding #249

Open
jordanmills opened this issue Jun 4, 2024 · 1 comment
Open

Any URL parsing rule with invalid regex breaks all geocoding #249

jordanmills opened this issue Jun 4, 2024 · 1 comment

Comments

@jordanmills
Copy link

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>)
@esm7
Copy link
Owner

esm7 commented Jun 8, 2024

Will fix, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants