html: Add *provisional* implementation for MATH

This commit is contained in:
Xavier Mendez 2014-08-18 12:04:03 +02:00
parent c2ac3702a7
commit 0088492f5e

View file

@ -533,6 +533,15 @@ rndr_footnote_ref(hoedown_buffer *ob, unsigned int num, void *opaque)
return 1;
}
static int
rndr_math(hoedown_buffer *ob, const hoedown_buffer *text, int displaymode, void *opaque)
{
hoedown_buffer_put(ob, displaymode ? "\\[" : "\\(", 2);
escape_html(ob, text->data, text->size);
hoedown_buffer_put(ob, displaymode ? "\\]" : "\\)", 2);
return 1;
}
static void
toc_header(hoedown_buffer *ob, const hoedown_buffer *text, int level, void *opaque)
{
@ -622,6 +631,7 @@ hoedown_html_toc_renderer_new(int nesting_level)
rndr_strikethrough,
rndr_superscript,
NULL,
NULL,
NULL,
NULL,
@ -690,6 +700,7 @@ hoedown_html_renderer_new(unsigned int render_flags, int nesting_level)
rndr_strikethrough,
rndr_superscript,
rndr_footnote_ref,
rndr_math,
NULL,
rndr_normal_text,