Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

  fixed

  • Loading branch information...
commit 315a55462cbab41b7f18e03e4794a757ef8ae463 1 parent 471fef9
@ivkosh authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/rdbl.erl
View
6 src/rdbl.erl
@@ -107,7 +107,8 @@ extract_content_type(Tree, DefaultContentType) ->
%% @doc main function
%% takes document contens (Body) and document context (Ctx, see url_context/1)
%% returns simplified page as a string()
-simplify_page(Body, Ctx, DefaultContentType) ->
+simplify_page(Body0, Ctx, DefaultContentType) ->
+ Body = re:replace(Body0, " ", " ", [global]), % mochiweb_html:parse has a bug with  , just hotfix
try mochiweb_html:parse(Body) of % parse() will not work if Body contains no html tags
TreeOrig ->
TitleStr = get_title(TreeOrig),
@@ -359,7 +360,8 @@ fetch_page(Url) ->
inets:start(), % TODO: handle errors & not start if already started
ssl:start(),
% TODO: cache page - save to ets by url
- {ok, RequestId} = httpc:request(get, {Url, [{"User-Agent", ?USER_AGENT}]}, [{autoredirect, true}, {relaxed, true}], [{sync, false}, {receiver, self()}]),
+ % TODO: replace http:request to httpc:request
+ {ok, RequestId} = http:request(get, {Url, [{"User-Agent", ?USER_AGENT}]}, [{autoredirect, true}, {relaxed, true}], [{sync, false}, {receiver, self()}]),
receive
{http, {RequestId, Result}} ->
case Result of
Please sign in to comment.
Something went wrong with that request. Please try again.