Skip to content

Commit

Permalink
Optimize parse_flag (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypconstante authored Dec 18, 2023
1 parent 8496ccf commit fd49dd6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/floki_mochi_html.erl
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ tokens(B, S = #decoder{offset = O}, Acc) ->
end.

parse_flag({start_tag, B, _, false}) ->
case string:to_lower(binary_to_list(B)) of
"script" ->
case B of
<<"script">> ->
script;
"style" ->
<<"style">> ->
style;
"title" ->
<<"title">> ->
title;
"textarea" ->
<<"textarea">> ->
textarea;
_ ->
none
Expand Down

0 comments on commit fd49dd6

Please sign in to comment.