lib/kramdown/parser/kramdown/codeblock.rb in kramdown-0.11.0 vs lib/kramdown/parser/kramdown/codeblock.rb in kramdown-0.12.0

- old
+ new

@@ -19,11 +19,11 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. #++ # require 'kramdown/parser/kramdown/blank_line' -require 'kramdown/parser/kramdown/attribute_list' +require 'kramdown/parser/kramdown/extensions' require 'kramdown/parser/kramdown/eob' require 'kramdown/parser/kramdown/paragraph' module Kramdown module Parser @@ -32,10 +32,13 @@ CODEBLOCK_START = INDENT CODEBLOCK_MATCH = /(?:#{BLANK_LINE}?(?:#{INDENT}[ \t]*\S.*\n)+(?:(?!#{BLANK_LINE} {0,3}\S|#{IAL_BLOCK_START}|#{EOB_MARKER}|^#{OPT_SPACE}#{LAZY_END_HTML_STOP}|^#{OPT_SPACE}#{LAZY_END_HTML_START})^[ \t]*\S.*\n)*)*/ # Parse the indented codeblock at the current location. def parse_codeblock - @tree.children << new_block_el(:codeblock, @src.scan(CODEBLOCK_MATCH).gsub(/\n( {0,3}\S)/, ' \\1').gsub!(INDENT, '')) + data = @src.scan(self.class::CODEBLOCK_MATCH) + data.gsub!(/\n( {0,3}\S)/, ' \\1') + data.gsub!(INDENT, '') + @tree.children << new_block_el(:codeblock, data) true end define_parser(:codeblock, CODEBLOCK_START)