import org.sonar.channel.RegexChannel;
/**
- * Markdown treats double simple quotes ('') as indicators of code. Text wrapped with two '' will be wrapped with an HTML {@literal <code>} tag.
+ * Markdown treats double backtick quote (``) as indicators of code. Text wrapped with two `` will be wrapped with an HTML {@literal <code>} tag.
*
- * E.g., the input ''printf()'' will produce {@literal<code>}printf(){@literal</code>}
+ * E.g., the input ``printf()`` will produce {@literal<code>}printf(){@literal</code>}
*/
class HtmlCodeChannel extends RegexChannel<MarkdownOutput> {
public HtmlCodeChannel() {
- super("''.+?''");
+ super("``.+?``");
}
@Override
@Test
public void shouldDecorateCode() {
- assertThat(MarkdownEngine.convertToHtml("This is a ''line of code''"), is("This is a <code>line of code</code>"));
- assertThat(MarkdownEngine.convertToHtml("This is not a ''line of code"), is("This is not a ''line of code"));
+ assertThat(MarkdownEngine.convertToHtml("This is a ``line of code``"), is("This is a <code>line of code</code>"));
+ assertThat(MarkdownEngine.convertToHtml("This is not a ``line of code"), is("This is not a ``line of code"));
}
@Test