Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2010-06-01 01:53:45 -05:00
commit 55337ed43c
2 changed files with 17 additions and 5 deletions

View file

@ -251,6 +251,7 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser
"I see that #{h.rest.inspect} is left after the raw HTML.", src
end
raw_html = h.stuff_you_read
return md_html(raw_html)
end
@ -283,7 +284,8 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser
item_type = src.cur_line.md_type
first = src.shift_line
indentation = spaces_before_first_char(first)
indentation, ial = spaces_before_first_char(first)
al = read_attribute_list(CharSource.new(ial,src), context=nil, break_on=[nil]) if ial
break_list = [:ulist, :olist, :ial]
# Ugly things going on inside `read_indented_content`
lines, want_my_paragraph =
@ -300,7 +302,7 @@ module MaRuKu; module In; module Markdown; module BlockLevelParser
children = parse_blocks(src2)
with_par = want_my_paragraph || (children.size>1)
return md_li(children, with_par)
return md_li(children, with_par, al)
end
def read_abbreviation(src)

View file

@ -113,9 +113,14 @@ module MaRuKu; module Strings
while s[i,1] =~ /\s/; i+=1 end
# skip indicator (+, -, *)
i+=1
# skip whitespace
while s[i,1] =~ /\s/; i+=1 end
# find an IAL
ial = s[i,s.length - i][/^\{(.*?)\}/]
i+= ial.length if ial
# skip optional whitespace
while s[i,1] =~ /\s/; i+=1 end
return i
return [i, ial]
when :olist
i=0;
# skip whitespace
@ -124,12 +129,17 @@ module MaRuKu; module Strings
while s[i,1] =~ /\d/; i+=1 end
# skip dot
i+=1
# skip optional whitespace
while s[i,1] =~ /\s/; i+=1 end
# find an IAL
ial = s[i,s.length - i][/^\{(.*?)\}/]
i+= ial.length if ial
# skip whitespace
while s[i,1] =~ /\s/; i+=1 end
return i
return [i, ial]
else
tell_user "BUG (my bad): '#{s}' is not a list"
0
[0, nil]
end
end