duilio / pelican-octopress-theme

Octopress default theme copied for pelican
MIT License
149 stars 119 forks source link

Escaping title for Disqus JavaScript variable. #74

Closed dhermes closed 9 years ago

dhermes commented 9 years ago

Causes the JS to fail if a title contains a single quote (for example an apostrophe).

Also making whitespace consistent and removing tab characters in 'disqus_script.html'.

dhermes commented 9 years ago

@duilio Any chance we can get some of these reviewed?

duilio commented 9 years ago

Unfortunately jinja2 does not have a default js escaping filter (http://stackoverflow.com/questions/12339806/escape-strings-for-javascript-using-jinja2), this solution won't work in some edge cases but it's fine to fix problems with single quotes, so I'm going to accept it anyway.

dhermes commented 9 years ago

Thanks for the merge. I made this change due to the missing filter (as you mention).

I'm fairly certain this will always work. What corner cases do you have in mind?