-
Notifications
You must be signed in to change notification settings - Fork 22
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
":" in URLs should not be encoded #29
Comments
I've drawn up a subclass of Textile which looks like it will function for your needs: rawlink_textile.py Give it a try, and let me know if you need any further assistance. |
Thanks, I will. But it does seem like an awful lot of code (and an extra dependency on six). I wonder why the links are getting encoded in the first place...
|
Textile already requires six, so it's not an extra dependency. Encoding the URIs is just the right thing to do: https://en.wikipedia.org/wiki/Percent-encoding#Types_of_URI_characters I understand your use-case for it, but it seems that anything that processes URIs should be able to process the percent-encoded URI without issue. If it seems like the new version of textile broke your system, it's because textile was previously incorrect. |
I'm sorry, but that just doesn't make sense. That article pertains to encoding payload data, not markup. I don't have that issue with Markdown or reStructured Text, and Textile worked that way on Python for at least eight years (and before that on PHP - my site was a PHPWiki back in 2001). I also don't remember having that issue with the Java ports (which I used in Clojure when I did a test implementation a couple of years back), so as far as I'm concerned not encoding the schema in URLs is the expected behavior.
|
The way you have your URIs structured, they are not seen as having schemes (technically what you have are paths, which should be percent-encoded). And that's all due to the RFCs governing the structure of URIs. The part of the gist which I've modified has to do with urllib's handling and parsing of the URI. For instance:
I can't speak to how implementations of textile in other languages may have treated this situation in the past. My goal here is to have python-textile adhere as closely as possible to both the spec and php-textile in their current forms. (And unfortunately, we were so far behind the times that this update seems like a very drastic change.) For what it's worth, I've filed an issue on the textile-spec (textile/textile-spec#3) repo asking for some clarity on the proper handling of a situation like this. Please let me know if that gist resolves your issue. You could also put your schema transformation in that |
Sorry, but I still think this is a breaking change that needs to be fixed. Looking at the RedCloth ragel grammar (which is the closest I can find to a machine-readable formal definition of the Textile language, lacking other PEG or EBNF alternatives), the definition for a URL is pretty clear: https://github.com/jgarber/redcloth/blob/master/ragel/redcloth_common.rl#L111 https://github.com/jgarber/redcloth/blob/master/ragel/redcloth_common.rl#L111
|
...Still wondering if that gist works for you. |
Any update on whether the gist works for you? |
I stand by my previous statement that this is a breaking change that needs to be addressed. I haven't tried the gist because I need this to work without patching, and as such I reverted to the previous version. Sorry. |
The reason I keep asking is to confirm whether or not the gist actually solves your problem without causing other errors for you. Whether you choose to use it in production is totally up to you. (For what it's worth, the gist functions as a drop-in fix, not exactly a patch. You might be able to get away with I'm not going to make a change to this until we get a straight answer from textile-spec regarding a way forward. Sorry. |
I can wait (and simply vendor the old version). Nevertheless, so far, the research I did into RedCloth (including the "new" version) supports my case in terms of historical precedent (that particular bit of the grammar I linked to goes back ages). With some luck, the textile-spec folk will consider defining a formal grammar...
|
Following up from #27, custom URL schema processing requires the colon to not be URL-encoded.
The text was updated successfully, but these errors were encountered: