Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
cvarier committed Nov 5, 2021
1 parent 5066d54 commit 128560e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public final class MarkdownUtil {
private static final int MAX_LINE_LENGTH = 100;

/**
* Wrapper around {@link #markdownCellFormatWithRenderedHtml}, calling it with HTML rendering disabled.
* Wrapper around {@link #markdownCellFormatWithHtml}, calling it with HTML rendering disabled.
*
* @return The formatted string, upon which the following operations have been performed:
* <ul>
Expand All @@ -49,7 +49,7 @@ public final class MarkdownUtil {
* </ul>
*/
public String markdownCellFormat(String docString) {
return markdownCellFormatWithRenderedHtml(docString, false);
return markdownCellFormatWithHtml(docString, false);
}

/**
Expand All @@ -71,7 +71,7 @@ public String markdownCellFormat(String docString) {
* <li>Turn lingering new line tags into spaces (as they generally indicate intended line wrap.
* </ul>
*/
public String markdownCellFormatWithRenderedHtml(String docString, Boolean renderHtml) {
public String markdownCellFormatWithHtml(String docString, Boolean renderHtml) {
String resultString = docString.trim();
if (!renderHtml) {
resultString = htmlEscape(resultString);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,8 @@ public void testMarkdownCellFormat() throws Exception {
}

@Test
public void testMarkdownCellFormatWithRenderedHtml() throws Exception {
// Exercises markdownCellFormatWithRenderedHtml() with renderHtml set to true
public void testMarkdownCellFormatWithHtml() throws Exception {
// Exercises markdownCellFormatWithHtml() with renderHtml set to true
String testData = " test_start <a></a>:\n"
+ " Test<br>\n"
+ " `test`\n"
Expand All @@ -868,6 +868,6 @@ public void testMarkdownCellFormatWithRenderedHtml() throws Exception {
+ "Test<br> <code>test</code> <pre><code> "
+ "test </code></pre><br><br> test<br><br> test_end";

assertThat(util.markdownCellFormatWithRenderedHtml(testData, true)).isEqualTo(expected);
assertThat(util.markdownCellFormatWithHtml(testData, true)).isEqualTo(expected);
}
}

0 comments on commit 128560e

Please sign in to comment.