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

Tag option parsing flaws #34

Open
Dijky opened this issue Nov 30, 2014 · 1 comment
Open

Tag option parsing flaws #34

Dijky opened this issue Nov 30, 2014 · 1 comment

Comments

@Dijky
Copy link

Dijky commented Nov 30, 2014

While working on #33 I noticed some inconsistencies in ending a tag option and proceeding to the next one:

  • in OPTION_STATE_VALUE, a trailing space is mandatory to detect the end of the value
  • in OPTION_STATE_QUOTED_VALUE, a peek-ahead is done to make sure a space (or end of tag content) comes next. If there is any other character, a ParserException is thrown and caught and all options will be interpreted as one.
  • in OPTION_STATE_JAVASCRIPT however, there is no such check.
    A tag like [video js=javascript: ok();x=y] is considered valid.

I can make a pull request once #33 has been decided, so the merges will not conflict.

I would also like to add single-quoted values ([tag opt='use " in here without problem']) and possibly backslash-escaping ([tag opt="this: \" is a double quote"]).

Another problem is using ] in a (quoted) tag option. Due to the current parser implementation this is impossible.
After all, the parser is not a complete DFSM since the tokenizer only knows [, ], and everything else as tokens.

@shmax
Copy link
Contributor

shmax commented Mar 19, 2015

@Dijky, how are you coming on this?

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