Skip to content

Commit

Permalink
Use new public interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Sep 6, 2024
1 parent 951e472 commit 41d69b0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ void cmark_render_code_point(cmark_renderer *renderer, uint32_t c) {
renderer->column += 1;
}

static inline int S_is_block(cmark_node *node) {
return node->type >= CMARK_NODE_FIRST_BLOCK && node->type <= CMARK_NODE_LAST_BLOCK;
}

char *cmark_render(cmark_node *root, int options, int width,
void (*outc)(cmark_renderer *, cmark_escaping, int32_t,
unsigned char),
Expand Down Expand Up @@ -183,7 +179,7 @@ char *cmark_render(cmark_node *root, int options, int width,
}

// If the root node is a block type (i.e. not inline), ensure there's a final newline:
if (S_is_block(root)) {
if (cmark_node_is_block(root)) {
if (renderer.buffer->size == 0 || renderer.buffer->ptr[renderer.buffer->size - 1] != '\n') {
cmark_strbuf_putc(renderer.buffer, '\n');
}
Expand Down

0 comments on commit 41d69b0

Please sign in to comment.