anchor.diff:              BinTag = makeTag(p, <<CT/binary>>),
               <<Html/binary, BinTag/binary>>
       end;
  +
  +%% Parse Lists
   convert(Content, State = #{state := [ol_start|St],
                              soFar := Html}) ->
       {true, NumBin, Rest} = parseOLNum(Content),
       Indent = byte_size(Content) - byte_size(Rest),
       Html2 = <<Html/binary, "<ol start='", NumBin/binary, "'>">>,
  -    convert(Rest, State#{state := [{ol_litem, Indent, <<>>}|St], soFar := Html2});
  -convert(<<>>, #{state     := PState = [{ol_litem, _, CT}|_],
  -                soFar     := Html}) ->
  -    BinTag = makeTag(li, CT),
  -    {CloseTags, _} = closeTags(0, PState),
  -    <<Html/binary, BinTag/binary, CloseTags/binary>>;
  -convert(<<13, 10, Rest/binary>>, State = #{state := [{ol_litem, Ind, CT}|St],
  -                                           soFar := Html}) ->
  -    BinTag = makeTag(li, CT),
  -    case parseOLNum(Rest, Ind) of
  -        {true, Num, Rest2} ->
  -            Indent2 = byte_size(Rest) - byte_size(Rest2),
  -            checkIndent(Indent2, Num, Rest2, BinTag, State);
  -        false ->
  -            Html2 = <<Html/binary, BinTag/binary, "</ol>">>,
  -            convert(Rest, State#{state := St,
  -                                 soFar := Html2})
  -    end;
  -convert(<<Char:8, Rest/binary>>, State = #{state := [{ol_litem, Ind, CT}|St]}) ->
  -    convert(Rest, State#{state := [{ol_litem, Ind, <<CT/binary, Char:8>>}|St]});
  +    convert(Rest, State#{state := [{ol, Indent, <<>>}|St], soFar := Html2});
   convert(Content, State = #{state := [ul_start|St], soFar := Html}) ->
       {true, Rest} = parseULBullet(Content),
       Indent       = byte_size(Content) - byte_size(Rest),
       Html2        = <<Html/binary, "<ul>">>,
  -    convert(Rest, State#{state := [{ul_litem, Indent, <<>>}|St], soFar := Html2});
  -convert(<<>>, #{state := PState = [{ul_litem, _, CT}|_],
  -                soFar := Html}) ->
  +    convert(Rest, State#{state := [{ul, Indent, <<>>}|St], soFar := Html2});
  +convert(<<>>, #{state := PState = [{Tag, _, CT}|_],
  +                soFar := Html}) when (Tag == ul) or (Tag == ol) ->
       BinTag         = makeTag(li, CT),
       {CloseTags, _} = closeTags(0, PState),
       <<Html/binary, BinTag/binary, CloseTags/binary>>;
  -convert(<<13, 10, Rest/binary>>, State = #{state := [{ul_litem, Ind, CT}|St],
  -                                           soFar := Html}) ->
  +convert(<<13, 10, Rest/binary>>, State = #{state := [{Tag, Ind, CT}|St],
  +                                           soFar := Html})
  +    when (Tag == ol) or (Tag == ul) ->
       BinTag = makeTag(li, CT),
  -    case parseULBullet(Rest, Ind) of
  -        {true, Rest2} ->
  +    case {Tag, parseList(Tag, Rest, Ind)} of
  +        {_, {true, Rest2}} ->
               Indent2 = byte_size(Rest) - byte_size(Rest2),
  -            checkIndent(Indent2, <<>>, Rest2, BinTag, State);
  -        false ->
  +            checkIndent(ul, Indent2, <<>>, Rest2, BinTag, State);
  +        {_, {true, Num, Rest2}} ->
  +            Indent2 = byte_size(Rest) - byte_size(Rest2),
  +            checkIndent(ol, Indent2, Num, Rest2, BinTag, State);
  +        {ul, false} ->
               Html2 = <<Html/binary, BinTag/binary, "</ul>">>,
  -            convert(Rest, State#{state := St,
  -                                 soFar := Html2})
  -    end;
  -convert(<<Char:8, Rest/binary>>, State = #{state := [{ul_litem, Ind, CT}|St]}) ->
  -    convert(Rest, State#{state := [{ul_litem, Ind, <<CT/binary, Char:8>>}|St]}).
  -
  -checkIndent(Indent, _, Rest, BinTag, State = #{state := [{Tag, Indent, CT}|St],
  -                                               soFar := Html}) ->
  +            convert(Rest, State#{state := St, soFar := Html2});
  +        {ol, false} ->
  +            Html2 = <<Html/binary, BinTag/binary, "</ol>">>,
  +            convert(Rest, State#{state := St, soFar := Html2})
  +    end;
  +convert(<<Char:8, Rest/binary>>, State = #{state := [{Tag, Ind, CT}|St]})
  +    when (Tag == ol) or (Tag == ul) ->
  +    convert(Rest, State#{state := [{Tag, Ind, <<CT/binary, Char:8>>}|St]}).
  +
  +
  +%% Check indentation of ordered and unorded lists.
  +checkIndent(_, Indent, _, Rest, BinTag, State = #{state := [{Tag, Indent, CT}|St],
  +                                                  soFar := Html}) ->
       BinTag = makeTag(li, CT),
       convert(Rest, State#{state := [{Tag, Indent, <<>>}|St],
                            soFar := <<Html/binary, BinTag/binary>>});
  -checkIndent(Ind1, _, Rest, BinTag, State = #{state := [{ul_litem, Ind2, CT}|St],
  -                                             soFar := Html}) ->
  +checkIndent(Tag, Ind1, Num, Rest, BinTag, State = #{state := [{PTag, Ind2, CT}|St],
  +                                                    soFar := Html}) ->
       case Ind1 > Ind2 of
           true ->
               BinTag   = makeTag(li, CT),
  -            NewState = [{ul_litem, Ind1, <<>>}, {ul_litem, Ind2, <<>>}|St],
  -            Html2    = <<Html/binary, BinTag/binary, "<ul>">>,
  +            NewState = [{Tag, Ind1, <<>>}, {PTag, Ind2, <<>>}|St],
  +            StartTag = makeStartTag(Tag, Num),
  +            Html2    = <<Html/binary, BinTag/binary, StartTag/binary>>,
               convert(Rest, State#{state := NewState,
                                    soFar := Html2});
           false ->
  -            {CTags, PState} = closeTags(Ind1, [{ul_litem, Ind2, CT}|St]),
  +            {CTags, PState} = closeTags(Ind1, [{PTag, Ind2, CT}|St]),
               Html2 = <<Html/binary, BinTag/binary, CTags/binary>>,
               convert(Rest, State#{state := PState,
                                    soFar := Html2})
  -    end;
  -checkIndent(Ind1, Num, Rest, BinTag, State = #{state := [{ol_litem, Ind2, CT}|St],
  -                                               soFar := Html}) ->
  -    case Ind1 > Ind2 of
  -        true ->
  -            BinTag   = makeTag(li, CT),
  -            NewState = [{ol_litem, Ind1, <<>>}, {ol_litem, Ind2, <<>>}|St],
  -            StartTag = <<"<ol start='", Num/binary, "'>">>,
  -            Html2    = <<Html/binary, BinTag/binary, StartTag/binary>>,
  -            convert(Rest, State#{state := NewState,
  -                                 soFar := Html2});
  -        false ->
  -            Html2 = <<Html/binary, BinTag/binary, "</ol>">>,
  -            convert(Rest, State#{state := St,
  -                                 soFar := Html2})
  -    end.
  -
  +    end.
  +
  +makeStartTag(ol, Num) ->
  +    <<"<ol start='", Num/binary, "'>">>;
  +makeStartTag(ul, _Num) ->
  +    <<"<ul>">>.
  +
  +% Close tags left open or to a specific indentation(used by lists)
   closeTags(Ind, PState) ->
       closeTags(Ind, PState, <<>>).
   
   closeTags(_Ind, [], SoFar) ->
       {SoFar, []};
  -closeTags(Ind, [{ul_litem, Ind, CT}|Rest], SoFar) ->
  -    {SoFar, [{ul_litem, Ind, CT}|Rest]};
  -closeTags(Ind1, [{ul_litem, Ind2, _}|Rest], SoFar) when Ind1 < Ind2 ->
  +closeTags(Ind, [{ul, Ind, CT}|Rest], SoFar) ->
  +    {SoFar, [{ul, Ind, CT}|Rest]};
  +closeTags(Ind1, [{ul, Ind2, _}|Rest], SoFar) when Ind1 < Ind2 ->
       closeTags(Ind1, Rest, <<SoFar/binary, "</ul>">>);
  -closeTags(Ind, [{ol_litem, Ind, CT}|Rest], SoFar) ->
  -    {SoFar, [{ol_litem, Ind, CT}|Rest]};
  -closeTags(Ind1, [{ol_litem, Ind2, _}|Rest], SoFar) when Ind1 < Ind2 ->
  +closeTags(Ind, [{ol, Ind, CT}|Rest], SoFar) ->
  +    {SoFar, [{ol, Ind, CT}|Rest]};
  +closeTags(Ind1, [{ol, Ind2, _}|Rest], SoFar) when Ind1 < Ind2 ->
       closeTags(Ind1, Rest, <<SoFar/binary, "</ol>">>);
   closeTags(_Ind, PState, SoFar) ->
       {SoFar, PState}.
  
positive.code:     convert(Rest, State#{state := addCT(<<Char:8>>, PState)});
  
  %% Headers
  convert(<<"#", Rest/binary>>, State = #{state    := [{ptext, CT}|St],
                                          currLine := CL,
                                          soFar    := Html})
    when (CL == <<>>)     or
  
negative.code:                                           currLine := <<>>,
                                            soFar    := Html2});
                  Rest ->
                      State2 = [{p, <<CT/binary, 13, 10>>}|St],
                      convert(Rest, State#{soFar    := Html,
                                           prevLine := CL,
                                           currLine := <<>>,
  