mapbox / mapbox/wellknown

Parser does not parse wkt's with whitespace after first '('

Open
#36 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
281
Forks
47
PR merge metrics
No merged PRs in 30d

Description

Hey,
I have a service which gives me wkt's with some whitespaces (Do not ask why..) .
After debugging the parse method, found that white() does not match the use case when there is a whitespace after the first '(' character.
Example:
LINESTRING ( 30 10, 10 30, 40 40)
It matches first two whitespaces, not matches the whitespace after '('.
Checked for other shapes as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the parser's parse method and inspect the white() matcher, then reproduce the issue with `LINESTRING ( 30 10, 10 30, 40 40)`. Done means WKT strings with whitespace after the first opening parenthesis parse successfully, including the other shapes mentioned in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.