Sha256: a59cbae4627c67a2df2ca4bbaa206a0be4bcfcbefeb63d4a029ecf1c9b7ef565
Contents?: true
Size: 1.03 KB
Versions: 2
Compression:
Stored size: 1.03 KB
Contents
# -*- coding: utf-8 -*- # #-- # Copyright (C) 2009-2014 Thomas Leitner <t_leitner@gmx.at> # # This file is part of kramdown which is licensed under the MIT. #++ # # RM require 'kramdown/parser/html' module Kramdown module Parser class Kramdown # 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 @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity(@src[1] || (@src[2] && @src[2].to_i) || @src[3].hex), 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) add_text(@src.matched[1..-1]) end end define_parser(:html_entity, Kramdown::Parser::Html::Constants::HTML_ENTITY_RE, '&') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
motion-kramdown-0.5.1 | lib/kramdown/parser/kramdown/html_entity.rb |
motion-kramdown-0.5.0 | lib/kramdown/parser/kramdown/html_entity.rb |