Skip to content

Commit

Permalink
Add even more sourcepos
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 14, 2023
1 parent 2f032ad commit 7e81f26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmark/latex.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

#define OUT(s, wrap, escaping) renderer->out(renderer, node, s, wrap, escaping)
#define LIT(s) renderer->out(renderer, node, s, false, LITERAL)
#define CR() renderer->cr(renderer)
#define CR() latex_out_sourcepos(node, renderer, options); renderer->cr(renderer)
#define BLANKLINE() latex_out_sourcepos(node, renderer, options); renderer->blankline(renderer)
#define LIST_NUMBER_STRING_SIZE 20

static CMARK_INLINE void latex_out_sourcepos(cmark_node *node, cmark_renderer *renderer, int options){
char buffer[100];
if (CMARK_OPT_SOURCEPOS & options) {
if (CMARK_OPT_SOURCEPOS & options && !renderer->need_cr) {
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 7e81f26

Please sign in to comment.