mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
remove xml tidying as it does not work yet
This commit is contained in:
5
pom.xml
5
pom.xml
@@ -172,11 +172,6 @@
|
|||||||
<artifactId>jsoup</artifactId>
|
<artifactId>jsoup</artifactId>
|
||||||
<version>1.7.2</version>
|
<version>1.7.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>net.sourceforge.htmlcleaner</groupId>
|
|
||||||
<artifactId>htmlcleaner</artifactId>
|
|
||||||
<version>2.4</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
|||||||
@@ -8,10 +8,6 @@ import javax.ejb.Stateless;
|
|||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.SystemUtils;
|
import org.apache.commons.lang.SystemUtils;
|
||||||
import org.htmlcleaner.CleanerProperties;
|
|
||||||
import org.htmlcleaner.HtmlCleaner;
|
|
||||||
import org.htmlcleaner.SimpleHtmlSerializer;
|
|
||||||
import org.htmlcleaner.TagNode;
|
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
|
|
||||||
import com.commafeed.backend.model.Feed;
|
import com.commafeed.backend.model.Feed;
|
||||||
@@ -50,6 +46,7 @@ public class FeedParser {
|
|||||||
feed.getEntries().add(entry);
|
feed.getEntries().add(entry);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
throw new FeedException(String.format(
|
throw new FeedException(String.format(
|
||||||
"Could not parse feed from %s : %s", feedUrl,
|
"Could not parse feed from %s : %s", feedUrl,
|
||||||
e.getMessage()), e);
|
e.getMessage()), e);
|
||||||
@@ -76,15 +73,8 @@ public class FeedParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String balanceTags(String xml) throws Exception {
|
private String balanceTags(String xml) throws Exception {
|
||||||
HtmlCleaner cleaner = new HtmlCleaner();
|
// TODO close tags
|
||||||
CleanerProperties props = cleaner.getProperties();
|
return xml;
|
||||||
props.setOmitXmlDeclaration(true);
|
|
||||||
TagNode node = cleaner.clean(xml);
|
|
||||||
SimpleHtmlSerializer serializer = new SimpleHtmlSerializer(
|
|
||||||
cleaner.getProperties());
|
|
||||||
String result = serializer.getAsString(node);
|
|
||||||
result = StringUtils.trim(xml);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String handleContent(String content) {
|
private String handleContent(String content) {
|
||||||
|
|||||||
Reference in New Issue
Block a user