Package jodd.lagarto.adapter

Source Code of jodd.lagarto.adapter.StripHtmlTest

// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.lagarto.adapter;

import jodd.lagarto.LagartoParser;
import jodd.lagarto.TagWriter;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class StripHtmlTest {

  @Test
  public void testStripHtml() {
    LagartoParser lagartoParser = new LagartoParser(
        "<html>  <div   id='a'>   x \n\n\n </div>  </html>", false);

    StringBuilder out = new StringBuilder();
    StripHtmlTagAdapter stripHtmlTagAdapter = new StripHtmlTagAdapter(new TagWriter(out));

    lagartoParser.parse(stripHtmlTagAdapter);

    assertEquals("<html><div id=\"a\"> x </div></html>", out.toString());
  }
}
TOP

Related Classes of jodd.lagarto.adapter.StripHtmlTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.