Skip to content

Instantly share code, notes, and snippets.

@Steppschuh
Last active December 20, 2016 15:31
Show Gist options
  • Save Steppschuh/d5e27578628ac8f77f5082baeb01f864 to your computer and use it in GitHub Desktop.
Save Steppschuh/d5e27578628ac8f77f5082baeb01f864 to your computer and use it in GitHub Desktop.

Emphasis

@Test
public void example() throws Exception {
    StringBuilder sb = new StringBuilder()
            .append(new Text("I am normal")).append("\n")
            .append(new BoldText("I am bold")).append("\n")
            .append(new ItalicText("I am italic")).append("\n")
            .append(new StrikeThroughText("I am strike-through"));

    System.out.println(sb);
}

Output:

I am normal
**I am bold**
_I am italic_
~~I am strike-through~~

Rendered:

I am normal

I am bold

I am italic

I am strike-through

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment