anchor.diff:        #button{id=submit, text="Submit",postback="add-comment-" ++ Id}
     ]}.
   
  +sanit(T) ->
  +  StripList = "[<>=&$#@!*%];\"\'`",
  +  re:replace(mtws_sanitizer:sanitize(T), StripList, "", [global, {return, list}, unicode]).
  +
  +sanitize_fix(Text) ->
  +  case re:run(Text, "^\\s*<\\s*p\\s*>.*", [{capture, [0], list}]) of
  +    nomatch -> iolist_to_binary(["<p>", Text, "</p>"]);
  +    {match, _} -> iolist_to_binary([Text])
  +  end.
  +
  +event({post_edit, Post}) ->
  +  wf:replace("post-body",post_editor("post-body", Post#mt_post.body, Post#mt_post.tags, "Save", {save_post, Post}, "Cancel", {cancel_edit, Post})),
  +  ok;
  +event({cancel_edit, Post}) ->
  +  wf:replace("post-body", post_body(Post)),
  +  ok;
  +event({save_post, #mt_post{id = PostId, author = #mt_author{id = PostAuthorId}} = Post}) ->
  +  User = wf:user(),
  +  UserBin = list_to_binary(User),
  +  if
  +    PostAuthorId =/= UserBin ->
  +      error;
  +    true ->
  +      Text = wf:q("textarea"),
  +      Tags = wf:q("tags-input"),
  +      mtc_entry:supdate(Post#mt_post{
  +        body = case Text of undefined -> Text; _ -> unicode:characters_to_binary(mtws_sanitizer:sanitize(sanitize_fix(Text))) end,
  +        tags = [unicode:characters_to_binary(sanit(unicode:characters_to_binary(T))) || T <- string:tokens(unicode:characters_to_list(list_to_binary(Tags)), ",")],
  +        origin = ?MT_ORIGIN
  +      })
  +  end,
  +  wf:redirect("/post/"++?a2l(PostId)),
  +  ok;
   event("add-post") ->
     User = wf:user(),
     if
       User =/= undefined ->
         Text = wf:q("textarea"),
         Tags = wf:q("tags-input"),
  -      Sanit = fun(T) ->
  -        StripList = "[<>=&$#@!*%];\"\'`",
  -        re:replace(mtws_sanitizer:sanitize(T), StripList, "", [global, {return, list}, unicode])
  -      end,
   
         ?DBG("Tags: ~p", [Tags]),
         UserName = ?a2b(User),                        % FIXME
  
positive.code:       },
        IdBin = mtc_entry:sput(#mt_post{
          author = Author,
          body = case Text of undefined -> Text; _ -> unicode:characters_to_binary(mtws_sanitizer:sanitize(iolist_to_binary(["<p>", Text, "</p>"]))) end,
          origin = ?MT_ORIGIN,
          tags = [unicode:characters_to_binary(Sanit(unicode:characters_to_binary(T))) || T <- string:tokens(unicode:characters_to_list(list_to_binary(Tags)), ",")]
        }),
        Id = binary_to_list(IdBin),
        wf:redirect("/post/"++Id);
  
negative.code:           #panel{body = [
              #panel{class = "post-body", body = Post#mt_post.body}
            ]},
            default_items_post(Post),
            #hr{}
          ]}
        ] ||
  