package org.perfectable.visuable.richtext;

public final class EmphasisRichText implements RichText {

	private static final long serialVersionUID = 8286679421539819187L;

	private final RichText nested;

	public static EmphasisRichText of(RichText nested) {
		return new EmphasisRichText(nested);
	}

	private EmphasisRichText(RichText nested) {
		this.nested = nested;
	}

	@Override
	public void render(RichTextRenderer painter) {
		try (RichTextRenderer strongPainter = painter.emphasis()) {
			this.nested.render(strongPainter);
		}
	}

}
