anchor.diff:                    (_) -> false
                 end, Parents).
   
  +default_width() -> 80.
  +
   %%. vim: foldmethod=marker foldmarker=%%',%%.
  
positive.code:             end
      end;
  
  format_content_(#xmlElement{name = Name, content = Content} = E, Ctx) ->
      case layout_type(Name) of
          header -> format_header(E, Ctx);
          inline -> format_content(Content, Ctx);
          block  -> format_block_element(E, format_content(Content, Ctx))
      end.
  
  format_header(#xmlElement{name = Name, parents = Parents, content = Content} = E, Ctx) ->
      has_non_header_parents(E) andalso erlang:error({non_header_parents, Parents}, [E]),
  
negative.code:         h4     -> header;
          h5     -> header;
          h6     -> header;
          dl     -> block;
          ol     -> block;
          ul     -> block;
          _      -> inline
      end.
  
  cleanup_text(Text, _Ctx) ->
      %% TODO: this could clump together lines up to a viewport line length passed in Ctx...
      %% split on newlines, discard empty results, tag each line
      %[ {i, string:trim(Line)} || [_|_] = Line <- re:split(Text, "\n", [notempty, trim, {return, list}]) ].
      [{i, string:join([ string:trim(Line, leading) || [_|_] = Line <- re:split(Text, "\n", [notempty, trim, {return, list}]) ], "\n")}].
  
  cleanup_preformatted_text(Text, _Ctx) ->
      [ {l, Line} || Line <- string:tokens(Text, "\n") ].
  