From 7c520ecc5e3971c6c9373309eaef8b3527f85261 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 5 Nov 2014 17:21:55 -0800 Subject: Use regular strings for literal in render_stack. --- src/html/html.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/html') diff --git a/src/html/html.c b/src/html/html.c index fa7f028..5945476 100644 --- a/src/html/html.c +++ b/src/html/html.c @@ -10,7 +10,7 @@ typedef struct RenderStack { struct RenderStack *previous; - chunk literal; + char* literal; union { node_inl *inl; node_block *block; @@ -24,7 +24,6 @@ static void free_render_stack(render_stack * rstack) while (rstack) { tempstack = rstack; rstack = rstack->previous; - chunk_free(&(tempstack->literal)); free(tempstack); } } @@ -37,7 +36,7 @@ static render_stack* push_inline(render_stack* rstack, newstack = (render_stack*)malloc(sizeof(render_stack)); newstack->previous = rstack; newstack->next_sibling.inl = inl; - newstack->literal = chunk_literal(literal); + newstack->literal = literal; return newstack; } @@ -50,7 +49,7 @@ static render_stack* push_block(render_stack* rstack, newstack = (render_stack*)malloc(sizeof(render_stack)); newstack->previous = rstack; newstack->next_sibling.block = block; - newstack->literal = chunk_literal(literal); + newstack->literal = literal; newstack->tight = tight; return newstack; } @@ -178,7 +177,7 @@ static void inlines_to_html(strbuf *html, node_inl* ils) ils = ils->next; } while (ils == NULL && rstack != NULL) { - strbuf_puts(html, rstack->literal.data); + strbuf_puts(html, rstack->literal); ils = rstack->next_sibling.inl; rstack = pop_render_stack(rstack); } -- cgit v1.2.3