anchor.diff:              end
       end;
   
  -format_content_(#xmlElement{name = Name, content = Content} = E, Ctx) ->
  +format_content_(#xmlElement{name = Name, pos = Pos, 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.
  +        inline -> format_inline_element(E, Ctx);
  +        block  -> format_block_element(E, Ctx)
  +    end.
  +
  +format_inline_element(#xmlElement{name = Name, pos = Pos, content = Content}, Ctx) ->
  +    %% Structure preview
  +    %Prefix = io_lib:format("~s ~p> ", [Name, Pos]),
  +    %WSSpan = [ " " || _ <- lists:seq(1, length(Prefix) + 1) ],
  +    %[{l, First} | Rest] = format_content(Content, Ctx),
  +    %[{l, [Prefix, First]} | [ {l, [WSSpan, L]} || {l, L} <- Rest ]].
  +    %%
  +    %Lines = format_content(Content, Ctx),
  +    %merge_lines(Lines, Ctx).
  +    %%
  +    format_content(Content, Ctx).
  +
  +merge_lines(Lines, Ctx) ->
  +    W = maps:get(width, Ctx, default_width()),
  +    #{lines := NewLines, current := {_, Current}} =
  +        lists:foldl(fun (L, Acc) -> merge_lines_(W, L, Acc) end,
  +                    #{lines => [], current => {0, []}}, Lines),
  +    lists:reverse([{l, lists:flatten(Current)} | NewLines]).
  +
  +merge_lines_(W, {l, L}, #{lines := Lines, current := {Len, Current}} = Acc) ->
  +    NewLen = Len + length(L),
  +    if
  +        NewLen =< W -> Acc#{current := {NewLen, [Current, L]}};
  +        NewLen  > W -> Acc#{lines := append_line(Current, Lines),
  +                            current := {length(L), [L]}}
  +    end.
  +
  +append_line(Current, Lines) ->
  +    [{l, lists:flatten(Current)} | Lines].
   
   format_header(#xmlElement{name = Name, parents = Parents, content = Content} = E, Ctx) ->
       has_non_header_parents(E) andalso erlang:error({non_header_parents, Parents}, [E]),
  
positive.code:                   (_) -> true
                end, lists:nthtail(Drop, Parents)).
  
  format_block_element(#xmlElement{name = Name}, Formatted) ->
      ["\n", io_lib:format("~s", [Name]), "> ",  Formatted].
  
  layout_type(Tag) ->
      case Tag of
  
negative.code:                   (_) -> false
                end, Parents).
  
  default_width() -> 80.
  
  %%. vim: foldmethod=marker foldmarker=%%',%%.
  