diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-05 17:21:55 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-05 17:21:55 -0800 |
commit | 7c520ecc5e3971c6c9373309eaef8b3527f85261 (patch) | |
tree | 9ba1828035ba61f244bf8ec664e9ed8f74b3dbcb | |
parent | a76a035b7f46a8d943f29ddfd664abb69e837a7a (diff) |
Use regular strings for literal in render_stack.
-rw-r--r-- | src/html/html.c | 9 |
1 files changed, 4 insertions, 5 deletions
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); } |