Skip to content

Commit

Permalink
Skip empty nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 15, 2023
1 parent 78d97f6 commit b0ef509
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmark/latex.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
static CMARK_INLINE void latex_out_sourcepos(cmark_node *node, cmark_renderer *renderer, int options, int blankline){
char buffer[100];
if (CMARK_OPT_SOURCEPOS & options && !renderer->need_cr && (node->type != CMARK_NODE_CODE_BLOCK || blankline)) {
if(cmark_node_get_start_line(node) == 0)
return; //elements without node such as softbreaks
snprintf(buffer, 100, " %%sourcepos(%d:%d-%d:%d)",
cmark_node_get_start_line(node), cmark_node_get_start_column(node),
cmark_node_get_end_line(node), cmark_node_get_end_column(node));
Expand Down

0 comments on commit b0ef509

Please sign in to comment.