Permalink
Browse files

categories now url-escaped by default

  • Loading branch information...
1 parent b5851b8 commit e5438a4a74d70ffe399db3f081d2ae4f05c3481a @acmarques committed Oct 30, 2010
Showing with 4 additions and 3 deletions.
  1. +1 −1 lib/wheat.js
  2. +3 −2 lib/wheat/data.js
View
@@ -59,7 +59,7 @@ module.exports = function setup(repo) {
addRoute(/^\/()([a-z0-9_-]+)$/, Renderers.article);
addRoute(/^\/()(.+\.dot)$/, Renderers.dotFile);
addRoute(/^\/()(.+\.[a-z]{2,4})$/, Renderers.staticFile);
- addRoute(/^\/()category\/([a-z0-9_-]+)$/, Renderers.categoryIndex);
+ addRoute(/^\/()category\/([\%\.a-z0-9_-]+)$/, Renderers.categoryIndex);
return function handle(req, res, next) {
View
@@ -2,7 +2,8 @@ var Git = require('git-fs'),
Path = require('path'),
Step = require('step'),
sys = require('sys'),
- Script = process.binding('evals').Script;
+ Script = process.binding('evals').Script,
+ QueryString = require('querystring');
function preProcessMarkdown(markdown) {
if (!(typeof markdown === 'string')) {
@@ -208,7 +209,7 @@ var Data = module.exports = {
if(props.categories != undefined){
props.categories = props.categories.split(',').map(function(element){
- return element.trim();
+ return QueryString.escape(element.trim());
});
}
return props;

0 comments on commit e5438a4

Please sign in to comment.