Skip to content

Commit cc0023a

Browse files
committed
Fix failing gfm_tagfilter test.
1 parent f261af8 commit cc0023a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

apps/markdown/src/util/markdown_util_gfm_tagfilter.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ find_tag_name_end(_Bytes, _NameStart, NameEnd, _Len) ->
8484
Start :: non_neg_integer(),
8585
Len :: non_neg_integer().
8686
gfm_tagfilter_loop(Bytes, Result1, Index1, Start1, Len) when Index1 < Len ->
87-
case Bytes of
88-
<<$<, _/bytes>> ->
87+
case binary:at(Bytes, Index1) of
88+
$< ->
8989
%% Optional `/`.
9090
NameStart =
91-
case Bytes of
92-
<<$<, $/, _/bytes>> ->
91+
case (Index1 + 1) < Len andalso binary:at(Bytes, Index1 + 1) =:= $/ of
92+
true ->
9393
Index1 + 2;
94-
_ ->
94+
false ->
9595
Index1 + 1
9696
end,
9797
%% Tag name.

0 commit comments

Comments
 (0)