You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by be...@apache.org on 2014/02/13 17:05:58 UTC

[03/50] mochiweb commit: updated refs/heads/import-upstream to 8eb1f22

normalize whitespace


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/commit/bfc0c386
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/tree/bfc0c386
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/diff/bfc0c386

Branch: refs/heads/import-upstream
Commit: bfc0c3862f50f2aebccf6c7308cb2305dfe82944
Parents: 92b8f5b
Author: Bob Ippolito <bo...@redivi.com>
Authored: Mon May 6 14:36:03 2013 -0700
Committer: Bob Ippolito <bo...@redivi.com>
Committed: Mon May 6 14:36:03 2013 -0700

----------------------------------------------------------------------
 src/mochiweb_html.erl | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mochiweb/blob/bfc0c386/src/mochiweb_html.erl
----------------------------------------------------------------------
diff --git a/src/mochiweb_html.erl b/src/mochiweb_html.erl
index 965c846..1d90f3b 100644
--- a/src/mochiweb_html.erl
+++ b/src/mochiweb_html.erl
@@ -95,7 +95,7 @@ to_tokens({Tag0, Acc}) ->
     to_tokens({Tag0, [], Acc});
 to_tokens({Tag0, Attrs, Acc}) ->
     Tag = to_tag(Tag0),
-    case is_singleton(Tag) of 
+    case is_singleton(Tag) of
         true ->
             to_tokens([], [{start_tag, Tag, Attrs, true}]);
         false ->
@@ -317,7 +317,7 @@ tokenize(B, S=#decoder{offset=O}) ->
             {Tag, S1} = tokenize_literal(B, ?ADV_COL(S, 2)),
             {S2, _} = find_gt(B, S1),
             {{end_tag, Tag}, S2};
-        <<_:O/binary, "<", C, _/binary>> 
+        <<_:O/binary, "<", C, _/binary>>
                 when ?IS_WHITESPACE(C); not ?IS_LITERAL_SAFE(C) ->
             %% This isn't really strict HTML
             {{data, Data, _Whitespace}, S1} = tokenize_data(B, ?INC_COL(S)),
@@ -581,9 +581,9 @@ find_qgt(Bin, S=#decoder{offset=O}) ->
         <<_:O/binary, "?>", _/binary>> ->
             ?ADV_COL(S, 2);
         <<_:O/binary, ">", _/binary>> ->
-			?ADV_COL(S, 1);
+                        ?ADV_COL(S, 1);
         <<_:O/binary, "/>", _/binary>> ->
-			?ADV_COL(S, 2);
+                        ?ADV_COL(S, 2);
         %% tokenize_attributes takes care of this state:
         %% <<_:O/binary, C, _/binary>> ->
         %%     find_qgt(Bin, ?INC_CHAR(S, C));
@@ -1244,7 +1244,7 @@ parse_quoted_attr_test() ->
         {<<"html">>,[],[
             { <<"a">>, [ { <<"href">>, <<"#">> }, {<<"onclick">>, <<"javascript: test(1,\ntrue);">>} ], [] }
         ]},
-        mochiweb_html:parse(D3)),     
+        mochiweb_html:parse(D3)),
     ok.
 
 parse_missing_attr_name_test() ->
@@ -1255,24 +1255,24 @@ parse_missing_attr_name_test() ->
     ok.
 
 parse_broken_pi_test() ->
-	D0 = <<"<html><?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" /></html>">>,
-	?assertEqual(
-		{<<"html">>, [], [
-			{ pi, <<"xml:namespace">>, [ { <<"prefix">>, <<"o">> },
-			                             { <<"ns">>, <<"urn:schemas-microsoft-com:office:office">> } ] }
-		] },
-		mochiweb_html:parse(D0)),
-	ok.
+        D0 = <<"<html><?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" /></html>">>,
+        ?assertEqual(
+                {<<"html">>, [], [
+                        { pi, <<"xml:namespace">>, [ { <<"prefix">>, <<"o">> },
+                                                     { <<"ns">>, <<"urn:schemas-microsoft-com:office:office">> } ] }
+                ] },
+                mochiweb_html:parse(D0)),
+        ok.
 
 parse_funny_singletons_test() ->
-	D0 = <<"<html><input><input>x</input></input></html>">>,
-	?assertEqual(
-		{<<"html">>, [], [
-			{ <<"input">>, [], [] },
-			{ <<"input">>, [], [ <<"x">> ] }
-		] },
-		mochiweb_html:parse(D0)),
-	ok.
+        D0 = <<"<html><input><input>x</input></input></html>">>,
+        ?assertEqual(
+                {<<"html">>, [], [
+                        { <<"input">>, [], [] },
+                        { <<"input">>, [], [ <<"x">> ] }
+                ] },
+                mochiweb_html:parse(D0)),
+        ok.
 
 to_html_singleton_test() ->
     D0 = <<"<link />">>,
@@ -1319,13 +1319,13 @@ parse_amp_test_() ->
 parse_unescaped_lt_test() ->
     D1 = <<"<div> < < <a href=\"/\">Back</a></div>">>,
     ?assertEqual(
-        {<<"div">>, [], [<<" < < ">>, {<<"a">>, [{<<"href">>, <<"/">>}], 
+        {<<"div">>, [], [<<" < < ">>, {<<"a">>, [{<<"href">>, <<"/">>}],
                                        [<<"Back">>]}]},
         mochiweb_html:parse(D1)),
 
     D2 = <<"<div> << <a href=\"/\">Back</a></div>">>,
     ?assertEqual(
-        {<<"div">>, [], [<<" << ">>, {<<"a">>, [{<<"href">>, <<"/">>}], 
+        {<<"div">>, [], [<<" << ">>, {<<"a">>, [{<<"href">>, <<"/">>}],
                                       [<<"Back">>]}]},
     mochiweb_html:parse(D2)).