コード例 #1
0
ファイル: xhtml.c プロジェクト: nono/upskirt
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)
		escape_html = 1;

	else if ((options->flags & XHTML_SKIP_STYLE) != 0 && is_html_tag(text, "style"))
		escape_html = 1;

	else if ((options->flags & XHTML_SKIP_LINKS) != 0 && is_html_tag(text, "a"))
		escape_html = 1;

	else if ((options->flags & XHTML_SKIP_IMAGES) != 0 && is_html_tag(text, "img"))
		escape_html = 1;


	if (escape_html)
		attr_escape(ob, text->data, text->size);
	else
		bufput(ob, text->data, text->size);

	return 1;
}
コード例 #2
0
ファイル: render.c プロジェクト: rcstolle/redcarpet
static int
rndr_raw_html(struct buf *ob, struct buf *text, void *opaque) {
	unsigned int flags = *(unsigned int *)opaque;
	int escape_html = 0;

	if (flags & RENDER_SKIP_HTML)
		escape_html = 1;

	else if ((flags & RENDER_SKIP_STYLE) != 0 && is_html_tag(text, "<style>"))
		escape_html = 1;

	else if ((flags & RENDER_SKIP_LINKS) != 0 && is_html_tag(text, "<a>"))
		escape_html = 1;

	else if ((flags & RENDER_SKIP_IMAGES) != 0 && is_html_tag(text, "<img>"))
		escape_html = 1;


	if (escape_html)
		lus_attr_escape(ob, text->data, text->size);
	else
		bufput(ob, text->data, text->size);

	return 1;
}
コード例 #3
0
ファイル: html.c プロジェクト: BinaryMuse/robotskirt
static int
rndr_raw_html(struct buf *ob, struct buf *text, void *opaque)
{
	struct html_renderopt *options = opaque;	

	if ((options->flags & HTML_SKIP_HTML) != 0)
		return 1;

	if ((options->flags & HTML_SKIP_STYLE) != 0 && is_html_tag(text, "style"))
		return 1;

	if ((options->flags & HTML_SKIP_LINKS) != 0 && is_html_tag(text, "a"))
		return 1;

	if ((options->flags & HTML_SKIP_IMAGES) != 0 && is_html_tag(text, "img"))
		return 1;

	bufput(ob, text->data, text->size);
	return 1;
}