Search in sources :

Example 1 with Text

use of org.commonmark.node.Text in project gitiles by GerritCodeReview.

the class MarkdownUtil method trimPreviousWhitespace.

static void trimPreviousWhitespace(Node node) {
    Node prev = node.getPrevious();
    if (prev instanceof Text) {
        Text prevText = (Text) prev;
        String s = prevText.getLiteral();
        prevText.setLiteral(CharMatcher.whitespace().trimTrailingFrom(s));
    }
}
Also used : Node(org.commonmark.node.Node) Text(org.commonmark.node.Text)

Aggregations

Node (org.commonmark.node.Node)1 Text (org.commonmark.node.Text)1