Skip to content

Conversation

@retsoksirhc
Copy link

Had a few people run into this lately, someone copies a drawtools polygon from iitc, the pastes it into a hangout along with descriptive text before or after. Someone else copies the whole text block and pastes it into drawtools, which fails to render because of the extra text.

This PR adds an extra try/catch that activates only if parsing the pasted JSON fails. It strips out anything before and after the first and last [{ }]. What's left is probably what the user actually wanted to paste, and is parsed as JSON.

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

Successfully merging this pull request may close these issues.

1 participant