For whatever reason, Sundown (more specifically Snudown, a fork of it) doesn't seem to output lines like:
> some text
As blockquotes in HTML, like it should, as it's valid Markdown. I know there are extensions in Sundown that allow certain features, but I cannot find one for quotes.
Here's the code I'm using (it's in Objective-C, but for the most part it's C):
struct sd_callbacks callbacks;
struct html_renderopt options;
const char *rawMarkdown = [markdownString cStringUsingEncoding:NSUTF8StringEncoding];
struct buf *inputBuffer = bufnew(strlen(rawMarkdown));
bufputs(inputBuffer, rawMarkdown);
// Parse the Markdown
struct buf *outputBuffer = bufnew(64);
sdhtml_renderer(&callbacks, &options, 0);
unsigned int extensions = MKDEXT_NO_INTRA_EMPHASIS|MKDEXT_TABLES|MKDEXT_FENCED_CODE|MKDEXT_AUTOLINK|MKDEXT_STRIKETHROUGH|MKDEXT_SUPERSCRIPT|MKDEXT_LAX_SPACING;
struct sd_markdown *markdown = sd_markdown_new(extensions, 16, 4, &callbacks, &options);
sd_markdown_render(outputBuffer, inputBuffer->data, inputBuffer->size, markdown);
sd_markdown_free(markdown);
NSString *HTML = [NSString stringWithCString:bufcstr(outputBuffer) encoding:NSUTF8StringEncoding];
bufrelease(inputBuffer);
bufrelease(outputBuffer);
NSLog(@"%@", HTML);
If a sample project would be helpful to show the issue, please just say so.
In HTML, '<' and '>' cannot be used directly,
Use an html entity:
>
to display >
<
to display <
Click edit to view it, the entity codes were used instead of '>' and '<'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With