Menu

#249 Incorrect line wrapping with …

open
nobody
None
5
2012-10-08
2011-06-29
Anonymous
No

The following program produces output with line wrapped inside xml entity.

    Tidy tidy = new Tidy();
    tidy.setRawOut(true);
    tidy.setAsciiChars(true);
    tidy.setFixBackslash(true);
    tidy.setHideComments(true);
    tidy.setXHTML(true);
    tidy.setInputEncoding("UTF-8");
    tidy.setOutputEncoding("UTF-8");
    tidy.setForceOutput(true);
    tidy.setWraplen(10);
    tidy.setErrout(new PrintWriter(new ByteArrayOutputStream(), false));

    String source ="<html><body><div>1234567&hellip;&lt;</div></body></html>";
    ByteArrayInputStream bais = new ByteArrayInputStream(source.getBytes("UTF-8"));
    Writer stringWriter = new StringWriter();
    tidy.parse(bais, stringWriter);
    System.out.println(stringWriter.toString());

This is the output:

<meta name="generator" content="HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net"> <title> </title>

1234567…& lt;

Discussion


Log in to post a comment.

MongoDB Logo MongoDB