diff --git a/lib/oga/xml/entities.rb b/lib/oga/xml/entities.rb index eaea9d6..63cd974 100644 --- a/lib/oga/xml/entities.rb +++ b/lib/oga/xml/entities.rb @@ -42,7 +42,7 @@ module Oga # # @return [Regexp] # - REGULAR_ENTITY = /&[a-zA-Z]+;/ + REGULAR_ENTITY = /&[a-zA-Z0-9]+;/ ## # Regexp for matching XML/HTML entities such as "&". diff --git a/spec/oga/html/entities_spec.rb b/spec/oga/html/entities_spec.rb index 7ee2204..b036c0f 100644 --- a/spec/oga/html/entities_spec.rb +++ b/spec/oga/html/entities_spec.rb @@ -11,5 +11,9 @@ describe Oga::HTML::Entities do it 'decodes λ into λ' do described_class.decode('λ').should == 'λ' end + + it 'decodes ½ into ½' do + described_class.decode('½').should == '½' + end end end