Skip to content

Commit

Permalink
Fix issue 264, inner_text for Nokogiri::HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
yokolet committed May 7, 2010
1 parent f4c7f36 commit ece18b6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ext/java/nokogiri/XmlNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,12 @@ public IRubyObject in_context(ThreadContext context,
@JRubyMethod
public IRubyObject content(ThreadContext context) {
if(this.content == null) {
String textContent = this.node.getTextContent();
String textContent;
if (this instanceof XmlDocument) {
textContent = this.node.getChildNodes().item(0).getTextContent();
} else {
textContent = this.node.getTextContent();
}
content = stringOrNil(context.getRuntime(), textContent);
}

Expand Down

0 comments on commit ece18b6

Please sign in to comment.