lib/kramdown/parser/kramdown/html_entity.rb in kramdown-2.4.0 vs lib/kramdown/parser/kramdown/html_entity.rb in kramdown-2.5.0
- old
+ new
@@ -16,10 +16,10 @@
# Parse the HTML entity at the current location.
def parse_html_entity
start_line_number = @src.current_line_number
@src.pos += @src.matched_size
begin
- value = ::Kramdown::Utils::Entities.entity(@src[1] || (@src[2]&.to_i) || @src[3].hex)
+ value = ::Kramdown::Utils::Entities.entity(@src[1] || @src[2]&.to_i || @src[3].hex)
@tree.children << Element.new(:entity, value,
nil, original: @src.matched, location: start_line_number)
rescue ::Kramdown::Error
@tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('amp'),
nil, location: start_line_number)