Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2826 from Alexendoo/fix-spoilers
Browse files Browse the repository at this point in the history
Fix spoilers replacing all the occurences of spoiler text
  • Loading branch information
ccrama authored Aug 3, 2018
2 parents 4ef311d + f9f4574 commit 3837ca4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ private String formatSpoilers(String html, Matcher matcher) {
String inner = "<a href=\"/spoiler\">spoiler&lt; [[s[ "
+ text
+ "]s]]</a>";
html = html.replace(text, inner);

int start = matcher.start(1);
html = html.substring(0, start)
+ inner
+ html.substring(start + text.length());
}
return html;
}
Expand Down

0 comments on commit 3837ca4

Please sign in to comment.