Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug Fixes #17

Open
wants to merge 8 commits into from
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 4 deletions.
  1. +6 −0 HTMLNode.m
  2. +7 −4 HTMLParser.m
View
6 HTMLNode.m
@@ -42,6 +42,7 @@ void setAttributeNamed(xmlNode * node, const char * nameStr, const char * value)
break;
}
}
+ free(newVal);
}
@@ -384,6 +385,11 @@ -(NSString*)allContents
return allNodeContents(_node);
}
+-(NSString *)description
+{
+ return [self rawContents];
+}
+
NSString * rawContentsOfNode(xmlNode * node)
{
xmlBufferPtr buffer = xmlBufferCreateSize(1000);
View
11 HTMLParser.m
@@ -84,10 +84,13 @@ -(id)initWithData:(NSData*)data error:(NSError**)error
const char *enc = CFStringGetCStringPtr(cfencstr, 0);
//_doc = htmlParseDoc((xmlChar*)[data bytes], enc);
- _doc = htmlReadDoc((xmlChar*)[data bytes],
- "",
- enc,
- XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
+
+ _doc = htmlReadMemory((char *)[data bytes],
+ (int)[data length],
+ "",
+ enc,
+ XML_PARSE_NOERROR | XML_PARSE_NOWARNING);
+
}
else
{
Something went wrong with that request. Please try again.