Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(119)

Issue 1518041: org.apache.shindig.gadgets.parse.DefaultHtmlSerializer#serialize drops trailing comments (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 10 months ago by janluehe
Modified:
15 years, 9 months ago
Reviewers:
Paul Lindner, shindig.remailer
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

This fixes https://issues.apache.org/jira/browse/SHINDIG-1354

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
java/gadgets/src/main/java/org/apache/shindig/gadgets/parse/DefaultHtmlSerializer.java View 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 3
janluehe
15 years, 10 months ago (2010-06-03 16:50:36 UTC) #1
Paul Lindner
Is there a test case? I started working on one with this patch but was ...
15 years, 9 months ago (2010-06-29 17:48:38 UTC) #2
janluehe
15 years, 9 months ago (2010-06-29 19:59:55 UTC) #3
Thanks for looking into this, Paul.

Below is a very simple test case.

To compile:
% javac -classpath shindig-gadgets.jar Test.java

To run:
% java -classpath
google-collections-1.0.jar:guice-2.0.jar:nekohtml-1.9.13.jar:shindig-gadgets.jar:.
Test

Without my fix, the output will be: "<ABC></ABC>"
With my fix, the output will be: "<ABC></ABC><!--XYZ-->"

import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.apache.shindig.gadgets.parse.*;

public class Test {

  public static void main(String[] args) throws Exception {
    Document doc =
DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    doc.appendChild(doc.createElement("ABC"));
    doc.appendChild(doc.createComment("XYZ"));

    DefaultHtmlSerializer serializer = new DefaultHtmlSerializer();
    System.out.println(serializer.serialize(doc));
  }
}


On 2010/06/29 17:48:38, Paul Lindner wrote:
> Is there a test case?   I started working on one with this patch but was
unable
> to get it working..
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b