Skip to content

Commit 3ebeee9

Browse files
committed
HTML scanner accepts boolean attributes; fixes issue #26
1 parent 27e8836 commit 3ebeee9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Changes.textile

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ p=. _This files lists all changes in the CodeRay library since the 0.9.8 release
77
h2. Changes in 1.0.7
88

99
* Fix issue with plugin files not being loaded. [GH-20, thanks to Will Read]
10+
* Fix HTML scanner bug: Don't choke on boolean attributes. [GH-26, thanks to jugglinmike]
1011

1112
h2. Changes in 1.0.6
1213

lib/coderay/scanners/html.rb

+1-4
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,9 @@ def scan_tokens encoder, options
149149
if match = scan(/=/) #/
150150
encoder.text_token match, :operator
151151
state = :attribute_value
152-
elsif scan(/#{ATTR_NAME}/o) || scan(/#{TAG_END}/o)
153-
state = :attribute
154-
next
155152
else
156-
encoder.text_token getch, :error
157153
state = :attribute
154+
next
158155
end
159156

160157
when :attribute_value

0 commit comments

Comments
 (0)