Skip to content

Commit

Permalink
add method make_headline
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Oct 29, 2012
1 parent 6311a25 commit 2959d4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/creole/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ def make_image(uri, alt)
end
end

def make_headline(level, text)
"<h#{level}>" << escape_html(text) << "</h#{level}>"
end

def make_explicit_link(link)
begin
uri = URI.parse(link)
Expand Down Expand Up @@ -324,7 +328,7 @@ def parse_block(str)
when /\A\s*(={1,6})\s*(.*?)\s*=*\s*$(\r?\n)?/
end_paragraph
level = $1.size
@out << "<h#{level}>" << escape_html($2) << "</h#{level}>"
@out << make_headline(level, $2)
when /\A[ \t]*\|.*$(\r?\n)?/
if !@stack.include?('table')
end_paragraph
Expand Down

0 comments on commit 2959d4d

Please sign in to comment.