summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes.textile1
-rw-r--r--coderay.gemspec2
-rw-r--r--lib/coderay.rb10
-rw-r--r--lib/coderay/scanners/html.rb5
4 files changed, 8 insertions, 10 deletions
diff --git a/Changes.textile b/Changes.textile
index 470ba33..4050253 100644
--- a/Changes.textile
+++ b/Changes.textile
@@ -7,6 +7,7 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release
h2. Changes in 1.0.7
* Fix issue with plugin files not being loaded. [GH-20, thanks to Will Read]
+* Fix HTML scanner bug: Don't choke on boolean attributes. [GH-26, thanks to jugglinmike]
h2. Changes in 1.0.6
diff --git a/coderay.gemspec b/coderay.gemspec
index ad7a2bb..1f88318 100644
--- a/coderay.gemspec
+++ b/coderay.gemspec
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
# thanks to @Argorak for this solution
# revision = 134 + (`git log --oneline | wc -l`.to_i)
# s.version = "#{CodeRay::VERSION}.#{revision}rc1"
- s.version = "#{CodeRay::VERSION}.rc1"
+ s.version = "#{CodeRay::VERSION}.rc2"
end
s.authors = ['Kornelius Kalnbach']
diff --git a/lib/coderay.rb b/lib/coderay.rb
index 876d770..88c7cc2 100644
--- a/lib/coderay.rb
+++ b/lib/coderay.rb
@@ -78,12 +78,12 @@
# Read this to get a general view what CodeRay provides.
#
# == Scanning
-#
-# Scanning means analysing an input string, splitting it up into Tokens.
-# Each Token knows about what type it is: string, comment, class name, etc.
+#
+# Scanning means analysing an input string, splitting it up into Tokens.
+# Each Token knows about what type it is: string, comment, class name, etc.
#
-# Each +lang+ (language) has its own Scanner; for example, <tt>:ruby</tt> code is
-# handled by CodeRay::Scanners::Ruby.
+# Each +lang+ (language) has its own Scanner; for example, <tt>:ruby</tt> code is
+# handled by CodeRay::Scanners::Ruby.
#
# CodeRay.scan:: Scan a string in a given language into Tokens.
# This is the most common method to use.
diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb
index 98d06fc..733dd6f 100644
--- a/lib/coderay/scanners/html.rb
+++ b/lib/coderay/scanners/html.rb
@@ -149,12 +149,9 @@ module Scanners
if match = scan(/=/) #/
encoder.text_token match, :operator
state = :attribute_value
- elsif scan(/#{ATTR_NAME}/o) || scan(/#{TAG_END}/o)
- state = :attribute
- next
else
- encoder.text_token getch, :error
state = :attribute
+ next
end
when :attribute_value