@Override protected void actionPerformed(final ActionEvent e, final NodeModel node) { final String nodeText = node.getText(); if (HtmlUtils.isHtmlNode(nodeText)) { ((MTextController) TextController.getController()) .setNodeText(node, HtmlUtils.htmlToPlain(nodeText)); } }
private String toHtml(String htmlOrPlainText) { if (HtmlUtils.isHtmlNode(htmlOrPlainText)) return htmlOrPlainText.replaceAll("</?(html|body)>", ""); else return HtmlUtils.toHTMLEscapedText(htmlOrPlainText); }