anchor.diff:  %%%
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  -parse({UrlRefs, ImgRefs, TypedLines}) -> io:format("in parse UrlRefs are ~p~n" ++
  -                                                   "ImgRefs are ~p~n" ++
  -                                                   "TypedLines are ~p~n",
  -                                                   [UrlRefs, ImgRefs, TypedLines]),
  -                                         p1(TypedLines, UrlRefs, ImgRefs, [], []).
  -
  +parse({UrlRefs, ImgRefs, TypedLines}) ->
  +    % io:format("in parse UrlRefs are ~p~n" ++
  +    %          "ImgRefs are ~p~n" ++
  +    %          "TypedLines are ~p~n",
  +    %          [UrlRefs, ImgRefs, TypedLines]),
  +    p1(TypedLines, UrlRefs, ImgRefs, [], []).
   
   %% goes through the lines
  -%% If it hits a 'stast' like 'blockquote' it throws a HTML fragment into the mix
  +%% If it hits a 'start' like 'blockquote' it throws a HTML fragment into the mix
   %% (eg <blockquote>) and then the matching closing one onto the stack (eg </blockquote>)
   %% when it hits a hard return it then throws the matching closing one back in...
   p1([], _Urls, _Imgs, [], Acc) ->
       flatten(reverse(Acc)); 
   p1([], _Urls, _Imgs, Stack, Acc) ->
       flatten(reverse([reverse(Stack) | Acc]));
  +
  +%% Tags have the highest precedence...
  +p1([{tag, Tag} | T], Urls, Imgs, Stack, Acc) ->
  +    case T of
  +        [{blank, _} | T2] -> p1(T2, Urls, Imgs, Stack,
  +                                [make_tag_str(Tag) | Acc]);
  +        _Other            -> p1(T, Urls, Imgs, Stack,
  +                                ["<p>" ++ make_str(Tag) ++ "</p>" | Acc])
  +    end;
   %% These clauses handle state issues
  -%% hit a blank line - you close the last open state (if it exists) and thow a <br />
  +%% hit a blank line - you close the last open state (if it exists) and
  +%% throw a <br />
   p1([{blank, _} | T], Urls, Imgs, [], Acc) ->
       p1(T, Urls, Imgs, [], ["<br />" | Acc]); 
   p1([{blank, _} | T], Urls, Imgs, [Close | Open], Acc) ->
  
positive.code: 
  unit_test_() ->
      [
       ?_assert(conv("3 > 4")            == "<p>3 &gt; 4</p>"),
       ?_assert(conv("blah\nblah")       == "<p>blah blah</p>"),
       ?_assert(conv("blah\r\nblah")     == "<p>blah blah</p>"),
       ?_assert(conv("blah\r\nblah  \n") == "<p>blah blah</p><br />"),
       ?_assert(conv("blahblah\n====")   == "<h1>blahblah</h1>"),
       ?_assert(conv("blahblah\n-----")  == "<h2>blahblah</h2>"),
       ?_assert(conv("# blahblah")       == "<h1>blahblah</h1>"),
       ?_assert(conv("## blahblah")      == "<h2>blahblah</h2>"),
       ?_assert(conv("### blahblah")     == "<h3>blahblah</h3>"),
  
negative.code: %% <BR /> typing
  t_l1([[{br, P}] | T], A1, A2, A3) -> t_l1(T, A1, A2, [{br, P} | A3]);
  
  %% Block level tags - these are look ahead they must be
  %% on a single line (ie directly followed by a linefeed and nothing else
  t_l1([[{{{tag, _Type}, Tag}, _} = H | T1] = List | T], A1, A2, A3) ->
      case is_blank(T1) of
          false -> t_l1(T, A1, A2, [{normal , List} | A3]);
          true  -> case is_block_tag(Tag) of
                       true  -> t_l1(T, A1, A2, [{tag , H} | A3]);
                       false -> t_l1(T, A1, A2, [{normal , List} | A3])
                   end
      end;
  
  %% Final clause
  t_l1([H | T], A1, A2, A3) -> t_l1(T, A1, A2, [{normal , H} | A3]).
  
  %%
  %% Loads of type rules...
  %%
  
  is_blank([])                        -> true;
  is_blank([{{linefeed, _}, _} | []]) -> true;
  is_blank([{{ws, _}, _} | T])        -> is_blank(T);
  is_blank(_List)                     -> false.
  
  is_block_tag("ADDRESS")    -> true;
  is_block_tag("BLOCKQUOTE") -> true;
  is_block_tag("CENTER")     -> true;
  is_block_tag("DIR")        -> true;
  is_block_tag("DIV")        -> true;
  is_block_tag("DL")         -> true;
  is_block_tag("FIELDSET")   -> true;
  is_block_tag("FORM")       -> true;
  is_block_tag("H1")         -> true;
  is_block_tag("H2")         -> true;
  is_block_tag("H3")         -> true;
  is_block_tag("H4")         -> true;
  is_block_tag("H5")         -> true;
  is_block_tag("H6")         -> true;
  is_block_tag("HR")         -> true;
  is_block_tag("ISINDEX")    -> true;
  is_block_tag("MENU")       -> true;
  is_block_tag("NOFRAMES")   -> true;
  is_block_tag("NOSCRIPT")   -> true;
  is_block_tag("OL")         -> true;
  is_block_tag("P")          -> true;
  is_block_tag("PRE")        -> true;
  is_block_tag("TABLE")      -> true;
  is_block_tag("UL")         -> true;
  is_block_tag(_Other)       -> false.
  
  type_underscore(List) -> case type_underscore1(trim_right(List)) of
                               hr    -> {hr, List};
                               maybe -> {type_underscore2(List), List}
  