diff --git a/lib/maruku/attributes.rb b/lib/maruku/attributes.rb index 98ddc992..840554e2 100644 --- a/lib/maruku/attributes.rb +++ b/lib/maruku/attributes.rb @@ -206,10 +206,13 @@ module MaRuKu; module In; module Markdown; module SpanLevelParser elsif after.kind_of? MDElement after.al = e.ial else - maruku_error "I don't know who you are referring to:"+ - " {#{e.ial.to_md}}", src, con + maruku_error "It is not clear to me what element this IAL {:#{e.ial.to_md}} \n"+ + "is referring to. The element before is a #{before.class.to_s}, \n"+ + "the element after is a #{after.class.to_s}.\n"+ + "\n before: #{before.inspect}"+ + "\n after: #{after.inspect}", + src, con # xxx dire se c'รจ empty vicino - maruku_recover "Ignoring IAL: {#{e.ial.to_md}}", src, con end end end diff --git a/lib/maruku/input/parse_block.rb b/lib/maruku/input/parse_block.rb index f142a300..bf7ec4d1 100644 --- a/lib/maruku/input/parse_block.rb +++ b/lib/maruku/input/parse_block.rb @@ -102,7 +102,7 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser when :raw_html; e = read_raw_html(src); output << e if e when :footnote_text; output.push read_footnote_text(src) - when :ref_definition; output.push read_ref_definition(src) + when :ref_definition; read_ref_definition(src, output) when :abbreviation; output.push read_abbreviation(src) when :xml_instr; read_xml_instruction(src, output) when :metadata; @@ -452,7 +452,7 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser end - def read_ref_definition(src) + def read_ref_definition(src, out) line = src.shift_line # if link is incomplete, shift next line @@ -465,7 +465,8 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser match = LinkRegex.match(line) if not match - error "Link does not respect format: '#{line}'" + maruku_error "Link does not respect format: '#{line}'" + return end id = match[1]; url = match[2]; title = match[3]; @@ -487,7 +488,7 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser end # puts hash.inspect - return md_ref_def(id, url, meta={:title=>title}) + out.push md_ref_def(id, url, meta={:title=>title}) end def read_table(src) diff --git a/lib/maruku/input/parse_span_better.rb b/lib/maruku/input/parse_span_better.rb index c256434b..c382c66b 100644 --- a/lib/maruku/input/parse_span_better.rb +++ b/lib/maruku/input/parse_span_better.rb @@ -278,7 +278,7 @@ module MaRuKu; module In; module Markdown; module SpanLevelParser end def extension_meta(src, con, break_on_chars) - if m = src.read_regexp(/(\w+):/) + if m = src.read_regexp(/([^\s\:]+):/) name = m[1] al = read_attribute_list(src, con, break_on_chars) # puts "#{name}=#{al.inspect}" diff --git a/lib/maruku/input/type_detection.rb b/lib/maruku/input/type_detection.rb index b2985021..ef9c4277 100644 --- a/lib/maruku/input/type_detection.rb +++ b/lib/maruku/input/type_detection.rb @@ -110,7 +110,7 @@ module MaRuKu; module Strings # This regex is taken from BlueCloth sources # Link defs are in the form: ^[id]: \n? url "optional title" LinkRegex = %r{ - ^[ ]*\[([^\]]+)\]: # id = $1 + ^[ ]{0,3}\[([^\[\]]+)\]: # id = $1 [ ]* ? # url = $2 [ ]* @@ -122,7 +122,7 @@ module MaRuKu; module Strings )? # title is optional }x - IncompleteLink = %r{^\s*\[(.+)\]:\s*$} + IncompleteLink = %r{^[ ]{0,3}\[([^\[\]]+)\]:\s*$} HeaderWithId = /^(.*)\{\#([\w_-]+)\}\s*$/ diff --git a/lib/maruku/output/to_html.rb b/lib/maruku/output/to_html.rb index 744dcd6f..e3ded8a9 100644 --- a/lib/maruku/output/to_html.rb +++ b/lib/maruku/output/to_html.rb @@ -762,7 +762,8 @@ of the form `#ff00ff`. i += num_columns end - table = create_html_element 'table' + table = create_html_element 'table', + [:summary, :width, :frame, :rules, :border, :cellspacing, :cellpadding] thead = Element.new 'thead' tr = Element.new 'tr' array_to_html(head).each do |x| tr<