提交 f35187be 编写于 作者: P Prem Sichanugrist 提交者: Prem Sichanugrist

Make sure that styles in NOTE block got converted

上级 2e89ac34
...@@ -7,13 +7,11 @@ def initialize(options={}) ...@@ -7,13 +7,11 @@ def initialize(options={})
def block_code(code, language) def block_code(code, language)
<<-HTML <<-HTML
<notextile>
<div class="code_container"> <div class="code_container">
<pre class="brush: #{brush_for(language)}; gutter: false; toolbar: false"> <pre class="brush: #{brush_for(language)}; gutter: false; toolbar: false">
#{ERB::Util.h(code).strip} #{ERB::Util.h(code).strip}
</pre> </pre>
</div> </div>
</notextile>
HTML HTML
end end
...@@ -24,8 +22,12 @@ def header(text, header_level) ...@@ -24,8 +22,12 @@ def header(text, header_level)
%(<h#{header_level}>#{text}</h#{header_level}>) %(<h#{header_level}>#{text}</h#{header_level}>)
end end
def preprocess(full_document) def paragraph(text)
convert_notes(full_document) if text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:](.*?)/
convert_notes(text)
else
"<p>#{text}</p>"
end
end end
private private
...@@ -61,7 +63,7 @@ def convert_notes(body) ...@@ -61,7 +63,7 @@ def convert_notes(body)
else else
$1.downcase $1.downcase
end end
%Q(<div class="#{css_class}"><p>#{$2.strip}</p></div>\n) %(<div class="#{css_class}"><p>#{$2.strip}</p></div>)
end end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册