JiLiZART / BBob

⚡️Blazing fast js bbcode parser, that transforms and parses bbcode to AST and transform it to HTML, React, Vue with plugin support in pure javascript, no dependencies
https://codepen.io/JiLiZART/full/vzMvpd
MIT License
163 stars 19 forks source link

URL parser does not handle [] in the link #252

Open celsworth opened 2 weeks ago

celsworth commented 2 weeks ago

I'm having trouble generating links if the URL has [] in it, which is used in Rails to pass through arrays and hashes. For example, this, an URL like this is not parsed:

https://shalazam.info/maps/1?x=1691.0&y=755.0&zoom=5.0&pin_loc[x]=3440&pin_loc[y]=3716

I can also repreoduce this on the bbob playground with an example as simple as:

[url=https://shalazam.info?loc[x]=1]test[/url]

Parsed to:

[
  "[",
  "url=https://shalazam.info?loc",
  {
    "tag": "x",
    "attrs": {},
    "content": []
  },
  "=1]test"
]

Removing the [x] makes it work.