Skip to content

Commit

Permalink
Add cap <br> to convert #24
Browse files Browse the repository at this point in the history
(cherry picked from commit 5b31fd6)
  • Loading branch information
ikeyat committed Feb 8, 2019
1 parent b377cc8 commit 29a23ab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class RemoveHtmlConverter implements Converter {
public String convert(String source) {
source = source.replaceAll("<br>", "\r\n");
source = source.replaceAll("<br */>", "\r\n");
source = source.replaceAll("<BR>", "\r\n");
source = source.replaceAll("<BR */>", "\r\n");
source = source.replaceAll("<[^<>]*>", "");
return source;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ public void testBrReplaced_003() {
assertThat(result, is("hoge\r\nfuga"));
}

@Test
public void testBrReplaced_004() {
Converter converter = new RemoveHtmlConverter();
String result = converter.convert("hoge<BR>fuga");
assertThat(result, is("hoge\r\nfuga"));
}

@Test
public void testBrReplaced_005() {
Converter converter = new RemoveHtmlConverter();
String result = converter.convert("hoge<BR/>fuga");
assertThat(result, is("hoge\r\nfuga"));
}

@Test
public void testBrReplaced_006() {
Converter converter = new RemoveHtmlConverter();
String result = converter.convert("hoge<BR />fuga");
assertThat(result, is("hoge\r\nfuga"));
}


@Test
public void testTagRemoved_001() {
Converter converter = new RemoveHtmlConverter();
Expand Down

0 comments on commit 29a23ab

Please sign in to comment.