Skip to content

Commit

Permalink
Parse non-rooted HTML correctly in HTML-only email
Browse files Browse the repository at this point in the history
  • Loading branch information
evanmiller committed Jun 15, 2010
1 parent d5b13ef commit 00035ac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/boss/boss_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ follow_link1(LinkName, ThisUrl, ParseTree, Assertions, Continuations) ->
parse_email_body(<<"text">>, <<"plain">>, Body) ->
{Body, []};
parse_email_body(<<"text">>, <<"html">>, Body) ->
ParsedBody = mochiweb_html:parse(Body),
{[], ParsedBody};
{[], parse_html_email_body(Body)};
parse_email_body(<<"multipart">>, <<"alternative">>,
[{<<"text">>, <<"plain">>, _, _, TextBody},
{<<"text">>, <<"html">>, _, _, HtmlBody}]) ->
ParsedHtmlBody = mochiweb_html:parse(<<"<html>", HtmlBody/binary, "</html>">>), %hack
{TextBody, ParsedHtmlBody}.
{TextBody, parse_html_email_body(HtmlBody)}.

parse_html_email_body(HtmlBody) -> %hack
mochiweb_html:parse(<<"<html>", HtmlBody/binary, "</html>">>).

fill_out_form(InputFields, InputLabels, FormValues) ->
MergedForm = lists:map(
Expand Down

0 comments on commit 00035ac

Please sign in to comment.