ext/xhtml.c in redcarpet-1.12.1 vs ext/xhtml.c in redcarpet-1.12.2

- old
+ new

@@ -435,27 +435,24 @@ static int rndr_raw_html(struct buf *ob, struct buf *text, void *opaque) { struct xhtml_renderopt *options = opaque; - int escape_html = 0; + if ((options->flags & XHTML_SKIP_HTML) != 0) + return 1; + if ((options->flags & XHTML_SKIP_STYLE) != 0 && is_html_tag(text, "style")) - escape_html = 1; + return 1; - else if ((options->flags & XHTML_SKIP_LINKS) != 0 && is_html_tag(text, "a")) - escape_html = 1; + if ((options->flags & XHTML_SKIP_LINKS) != 0 && is_html_tag(text, "a")) + return 1; - else if ((options->flags & XHTML_SKIP_IMAGES) != 0 && is_html_tag(text, "img")) - escape_html = 1; + if ((options->flags & XHTML_SKIP_IMAGES) != 0 && is_html_tag(text, "img")) + return 1; - - if (escape_html) - attr_escape(ob, text->data, text->size); - else - bufput(ob, text->data, text->size); - + bufput(ob, text->data, text->size); return 1; } static void rndr_table(struct buf *ob, struct buf *header, struct buf *body, void *opaque) @@ -783,13 +780,11 @@ if (render_flags & XHTML_SKIP_LINKS) { renderer->link = NULL; renderer->autolink = NULL; } - if (render_flags & XHTML_SKIP_HTML) { - renderer->raw_html_tag = NULL; + if (render_flags & XHTML_SKIP_HTML) renderer->blockhtml = NULL; - } if (render_flags & XHTML_SMARTYPANTS) renderer->normal_text = rndr_smartypants; if (render_flags & XHTML_GITHUB_BLOCKCODE)