-
Notifications
You must be signed in to change notification settings - Fork 7
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
Can't have parameterized queries in quotes containing ampersand #5
Comments
Shouldn't that be |
Not in a URL unless the developer "encodes" the Url. The Url should be able to accept & symbols by itself. |
Please let me know when there's a fix to this as I enjoy your library. |
Hi @christopherdengler you're right I hadn't realised the spec had changed in HTML5 to allow ambsersands, just been reading about it here https://mathiasbynens.be/notes/ambiguous-ampersands I'll look at implementing ambiguous ampersands in the next release :+ |
It's actually been around since before 1996, but as a PARAMETER DELIMITER. The ampersand is just a simple way to separate parameters such as http://mydomain.com/testpage?a=1&b=2&c=3 In that case, a=1, b=2, and c=3. However, you're right if you're referring to it as TEXT in the Url. http://example.com/Alice&Bob But there's really no way for your parser to know what the developer is trying to do. I would just allow it. Is there a simple fix you're putting in that I could manually code into the code that I have? |
@christopherdengler according to the article I referenced (as far as I understand it) and if I attempt to validate a document as HTML4 on the W3C then you can't use the following in 'http://mydomain.com/testpage?a=1&b=2&c=3' without it raising a validation error. So I think it's worth while having the default support ambiguous ampersands, but having a setting that allows for older behaviour such as displayed by HTML4 (perhaps XHTML not sure what this does). |
I'm wondering if you could send me your fix sooner than later? I'm implementing this in a project..? Much appreciated.. |
Hi @christopherdengler - really sorry I've taken a look this morning and the fix isn't immediately obvious to me (I need to modify the parser transitions that are handling entities and that's going to take me an hour or two I suspect to do and test) - unfortunately I'm stacked on work projects until the weekend but it'll be first on my list Saturday (or if things go better than expected I'll try to get it done this evening or tomorrow evening but I can't promise). |
Hi @christopherdengler as promised I've pushed a new release which caters for ambiguous ampersands. I've put in place a test to check for the various forms that from my understanding need to be supported but let me know if you have any issues. |
<a href="http://www.domain.com?x=1&b=3">asdfas</a>
Cannot parse with ampersand in the parameterized query.The text was updated successfully, but these errors were encountered: