diff --git a/markdown.m b/markdown.m index ae1bf8f..e3a2c2e 100644 --- a/markdown.m +++ b/markdown.m @@ -7,27 +7,24 @@ pathForResource:@"styles" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]; - + NSStringEncoding usedEncoding = 0; NSError *e = nil; - + NSString *source = [NSString stringWithContentsOfURL:url usedEncoding:&usedEncoding error:&e]; - + if (usedEncoding == 0) { NSLog(@"Wasn't able to determine encoding for file “%@”", [url path]); } char *output = convert_markdown_to_string([source UTF8String]); - NSString *html = [NSString stringWithFormat:@"" - "" - "" - "" + NSString *html = [NSString stringWithFormat:@"" + "" + "" "" - "" - "%@" - "", + "%@", styles, url, [NSString stringWithUTF8String:output]]; - + free(output); return [html dataUsingEncoding:NSUTF8StringEncoding]; } \ No newline at end of file