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

Jekyll breaks when using uri_escape on a string containing a colon after a space #5954

Closed
cameronmcefee opened this Issue Mar 14, 2017 · 5 comments

Comments

Projects
None yet
6 participants
@cameronmcefee

cameronmcefee commented Mar 14, 2017

  • I believe this to be a bug, not a question about using Jekyll.
  • I updated to the latest Jekyll (or) if on GitHub Pages to the latest github-pages
  • I read the CONTRIBUTION file at https://jekyllrb.com/docs/contributing/

  • I am on (or have tested on) macOS 10+
  • I am on (or have tested on) Debian/Ubuntu GNU/Linux
  • I am on (or have tested on) Fedora GNU/Linux
  • I am on (or have tested on) Arch GNU/Linux
  • I am on (or have tested on) Other GNU/Linux
  • I am on (or have tested on) Windows 10+

  • I was trying to install.
  • There is a broken Plugin API.
  • I had an error on GitHub Pages, and I have reproduced it locally.
  • I had an error on GitHub Pages, and GitHub Support said it was a Jekyll Bug.
  • I had an error on GitHub Pages and I did not test it locally.
  • I was trying to build.
  • It was another bug.

My Reproduction Steps

  1. Insert this snippet anywhere in a Jekyll page (works in index.html)
    {{ 'Foo : Bat' | uri_escape }}
  2. Receive error: Liquid Exception: Invalid scheme format: Foo in index.html

I've noticed that this is dependent on the colon following a space somewhere before it in the string. It doesn't have to be immediately before. For example:

{{ 'Foo : Bat' | uri_escape }} - Fail
{{ 'Foo bar: Bat' | uri_escape }} - Fail
{{ 'Foo: Bat' | uri_escape }} - Pass

The Output I Wanted

The page should build successfully, and the string should be escaped.

@FriesFlorian

This comment has been minimized.

Show comment
Hide comment
@FriesFlorian

FriesFlorian Mar 16, 2017

Hi @cameronmcefee, I'm glad you brought this issue up, I spent a couple hours trying to figure out what went wrong with my project. As you will see below, the problem is more complex than wether or not there's a space in front of the colon.

These strings will pass uri_escape
"test # : whatever"
"test: whatever"

These won't
"test : whatever"
"test foo: whatever"

I have no idea why this is happening, but I think it might be related to #5726 cc @pathawks

FriesFlorian commented Mar 16, 2017

Hi @cameronmcefee, I'm glad you brought this issue up, I spent a couple hours trying to figure out what went wrong with my project. As you will see below, the problem is more complex than wether or not there's a space in front of the colon.

These strings will pass uri_escape
"test # : whatever"
"test: whatever"

These won't
"test : whatever"
"test foo: whatever"

I have no idea why this is happening, but I think it might be related to #5726 cc @pathawks

@pathawks pathawks assigned pathawks and unassigned parkr Mar 16, 2017

@pathawks

This comment has been minimized.

Show comment
Hide comment
@pathawks

pathawks Mar 16, 2017

Member

@FriesFlorian You are right.

Addressable thinks we are trying to escape a full URI, instead of just a URI component.

Member

pathawks commented Mar 16, 2017

@FriesFlorian You are right.

Addressable thinks we are trying to escape a full URI, instead of just a URI component.

pathawks added a commit that referenced this issue Mar 21, 2017

@jekyllbot jekyllbot closed this in ec5b45c Mar 21, 2017

@cameronmcefee

This comment has been minimized.

Show comment
Hide comment
@parkr

This comment has been minimized.

Show comment
Hide comment
@parkr

parkr Mar 21, 2017

Member

@cameronmcefee If you're using GitHub Pages :octocat:, you can watch progress here: github/pages-gem#425 – I'll try to ship this 🔜 !

Member

parkr commented Mar 21, 2017

@cameronmcefee If you're using GitHub Pages :octocat:, you can watch progress here: github/pages-gem#425 – I'll try to ship this 🔜 !

@kainjow

This comment has been minimized.

Show comment
Hide comment
@kainjow

kainjow Mar 21, 2017

Contributor

We literally just patched our code to use cgi_escape to workaround this issue with 3.4.2. Glad it's been fixed :)

Contributor

kainjow commented Mar 21, 2017

We literally just patched our code to use cgi_escape to workaround this issue with 3.4.2. Glad it's been fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment