Browse Source

Included fix from sibling Fork

9473a8fee4
tags/v0.10
Frans Bouma 10 years ago
parent
commit
0267d3ffe4
1 changed files with 15 additions and 14 deletions
  1. +15
    -14
      src/MarkdownDeep/MardownDeep.cs

+ 15
- 14
src/MarkdownDeep/MardownDeep.cs View File

@@ -189,22 +189,23 @@ namespace MarkdownDeep
string strReturnLink = string.Format("<a href=\"#fnref:{0}\" rev=\"footnote\">&#8617;</a>", (string)fn.Data);

// Get the last child of the footnote
var child = fn.Children[fn.Children.Count - 1];
if (child.BlockType == BlockType.p)
if(fn.Children.Count > 0)
{
child.BlockType = BlockType.p_footnote;
child.Data = strReturnLink;
var child = fn.Children[fn.Children.Count - 1];
if(child.BlockType == BlockType.p)
{
child.BlockType = BlockType.p_footnote;
child.Data = strReturnLink;
}
else
{
child = CreateBlock();
child.ContentLen = 0;
child.BlockType = BlockType.p_footnote;
child.Data = strReturnLink;
fn.Children.Add(child);
}
}
else
{
child = CreateBlock();
child.ContentLen = 0;
child.BlockType = BlockType.p_footnote;
child.Data = strReturnLink;
fn.Children.Add(child);
}


fn.Render(this, sb);

sb.Append("</li>\n");


Loading…
Cancel
Save