@Test public void testCleanInlineCodeSimple() throws Exception { Assert.assertEquals("`hello & > world`", BASIC.cleanInlineCode("hello &amp; \n&gt; world")); }
public String cleanInlineCode(Object input) { String output = clean(input, false).replace('\n', ' '); if(output.indexOf('`') != -1) { String prepend = ""; if(output.charAt(0) == '`') { prepend = " "; } String append = ""; if(output.charAt(output.length()-1) == '`') { append = " "; } String delim = getDelimiter(output); output = String.format("%s%s%s%s%s", delim, prepend, output, append, delim); } else { output = String.format("`%s`", output); } return output; }
TextCleaner { public String cleanInlineCode(Object input) { String output = clean(input, false).replace('\n', ' '); if(output.indexOf('`') != -1) { String prepend = ""; if(output.charAt(0) == '`') { prepend = " "; } String append = ""; if(output.charAt(output.length()-1) == '`') { append = " "; } String delim = getDelimiter(output); output = String.format("%s%s%s%s%s", delim, prepend, output, append, delim); } else { output = String.format("`%s`", output); } return output; } }
TextCleaner { public String cleanInlineCode(Object input) { String output = clean(input, false).replace('\n', ' '); if(output.indexOf('`') != -1) { String prepend = ""; if(output.charAt(0) == '`') { prepend = " "; } String append = ""; if(output.charAt(output.length()-1) == '`') { append = " "; } String delim = getDelimiter(output); output = String.format("%s%s%s%s%s", delim, prepend, output, append, delim); } else { output = String.format("`%s`", output); } return output; } TextCleaner(Options options); }
TextCleaner { public String cleanInlineCode(Object input) { String output = clean(input, false).replace('\n', ' '); if(output.indexOf('`') != -1) { String prepend = ""; if(output.charAt(0) == '`') { prepend = " "; } String append = ""; if(output.charAt(output.length()-1) == '`') { append = " "; } String delim = getDelimiter(output); output = String.format("%s%s%s%s%s", delim, prepend, output, append, delim); } else { output = String.format("`%s`", output); } return output; } TextCleaner(Options options); String clean(Object input); String cleanCode(Object input); String cleanInlineCode(Object input); String unescapeLeadingCharacters(String input); String cleanUrl(String input); }
TextCleaner { public String cleanInlineCode(Object input) { String output = clean(input, false).replace('\n', ' '); if(output.indexOf('`') != -1) { String prepend = ""; if(output.charAt(0) == '`') { prepend = " "; } String append = ""; if(output.charAt(output.length()-1) == '`') { append = " "; } String delim = getDelimiter(output); output = String.format("%s%s%s%s%s", delim, prepend, output, append, delim); } else { output = String.format("`%s`", output); } return output; } TextCleaner(Options options); String clean(Object input); String cleanCode(Object input); String cleanInlineCode(Object input); String unescapeLeadingCharacters(String input); String cleanUrl(String input);  }