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

Includes in templates in paths with spaces #52

Closed
pbloem opened this issue Aug 16, 2013 · 1 comment
Closed

Includes in templates in paths with spaces #52

pbloem opened this issue Aug 16, 2013 · 1 comment
Assignees
Labels
Milestone

Comments

@pbloem
Copy link

pbloem commented Aug 16, 2013

Consider the following situation:

  • I have two files index.jade and head.jade
  • head.jade is called from index.jade by an include
  • Both are in a directory containing a space

In this case, trying to render index.jade will give an exception. The reason is that the include is parsed by taking the filename String used to create the parser for index.jade is translated to a URI using the method URI.create [Parser:313], which is assumed to accept only strictly legal URI string (ie. no spaces). The filename string used to create the parser for index.jade however, is passed (ultimately) to the constructor of a File object [FileTemplateLoader:37].

A quick fix would be to use new URI(...) in Parser:313, so the filename path is escaped. I think ultimately you may need to make a more consistent decision about how template paths are stored (eg. store them as URIs always, and use the 'file://' prefix for local files).

@chbloemer chbloemer added the bug label Oct 11, 2016
@chbloemer chbloemer self-assigned this Oct 11, 2016
@chbloemer chbloemer added this to the 1.2.4 milestone Oct 11, 2016
@chbloemer
Copy link
Contributor

Fixed in 1.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants