lib/kramdown/parser/kramdown/header.rb in kramdown-2.2.1 vs lib/kramdown/parser/kramdown/header.rb in kramdown-2.3.0
- old
+ new
@@ -6,10 +6,11 @@
# This file is part of kramdown which is licensed under the MIT.
#++
#
require 'kramdown/parser/kramdown/block_boundary'
+require 'rexml/xmltokens'
module Kramdown
module Parser
class Kramdown
@@ -38,10 +39,10 @@
end
define_parser(:atx_header, ATX_HEADER_START)
protected
- HEADER_ID = /[\t ]{#(?<id>[A-Za-z][\w:-]*)}\z/
+ HEADER_ID = /[\t ]{#(?<id>#{REXML::XMLTokens::NAME_START_CHAR}#{REXML::XMLTokens::NAME_CHAR}*)}\z/
# Returns header text and optional ID.
def parse_header_contents
text = @src["contents"]
text.rstrip!