Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Highlight should not be able to render local files.

  • Loading branch information...
commit d9bc00c80459409e454d4a72b477fcb75b2e22ce 1 parent 5e997ca
@mojombo mojombo authored
Showing with 16 additions and 4 deletions.
  1. +4 −0 History.txt
  2. +1 −1  lib/jekyll/albino.rb
  3. +11 −3 test/test_tags.rb
View
4 History.txt
@@ -1,3 +1,7 @@
+== HEAD
+ * Bug Fixes
+ * Highlight should not be able to render local files
+
== 0.6.2 / 2010-06-25
* Bug Fixes
* Fix Rakefile 'release' task (tag pushing was missing origin)
View
2  lib/jekyll/albino.rb
@@ -54,7 +54,7 @@ def self.colorize(*args)
end
def initialize(target, lexer = :text, format = :html)
- @target = File.exists?(target) ? File.read(target) : target rescue target
+ @target = target
@options = { :l => lexer, :f => format, :O => 'encoding=utf-8' }
end
View
14 test/test_tags.rb
@@ -24,9 +24,7 @@ def fill_post(code, override = {})
This document results in a markdown error with maruku
-{% highlight text %}
-#{code}
-{% endhighlight %}
+{% highlight text %}#{code}{% endhighlight %}
CONTENT
create_post(content, override)
end
@@ -45,6 +43,16 @@ def fill_post(code, override = {})
end
end
+ context "post content has highlight with file reference" do
+ setup do
+ fill_post("./jekyll.gemspec")
+ end
+
+ should "not embed the file" do
+ assert_match %{<pre><code class='text'>./jekyll.gemspec\n</code></pre>}, @result
+ end
+ end
+
context "post content has highlight tag with UTF character" do
setup do
fill_post("Æ")
Please sign in to comment.
Something went wrong with that request. Please try again.