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
167 stars 19 forks source link

Unable to handle case mismatch between start and end tags #250

Closed Alteras1 closed 1 month ago

Alteras1 commented 3 months ago

The engine is unable to properly close a tag if the ending tag has a different casing from the start tag.

For example:

[div style="border: 1px solid red"]
lorem ipsum
[/DIV]

gets parsed to

[
  {
    "tag": "div",
    "attrs": {
      "style": "border: 1px solid red"
    },
    "content": []
  },
  "\n",
  "lorem",
  " ",
  "ipsum",
  "\n"
]

On a secondary note: the orphaned closing tag is not added back into the output as plain text, giving the impression that it was accepted.