summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commonmark.c10
-rw-r--r--src/render.c2
-rw-r--r--src/render.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/commonmark.c b/src/commonmark.c
index 9f971b2..42a5f19 100644
--- a/src/commonmark.c
+++ b/src/commonmark.c
@@ -258,9 +258,9 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
}
LIT(" ");
renderer->begin_content = true;
- renderer->no_wrap = true;
+ renderer->no_linebreaks = true;
} else {
- renderer->no_wrap = false;
+ renderer->no_linebreaks = false;
BLANKLINE();
}
break;
@@ -343,8 +343,10 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
if (CMARK_OPT_HARDBREAKS & options) {
LIT(" ");
CR();
- } else if (renderer->width == 0 && !(CMARK_OPT_HARDBREAKS & options) &&
- !(CMARK_OPT_NOBREAKS & options)) {
+ } else if (!renderer->no_linebreaks &&
+ renderer->width == 0 &&
+ !(CMARK_OPT_HARDBREAKS & options) &&
+ !(CMARK_OPT_NOBREAKS & options)) {
CR();
} else {
OUT(" ", allow_wrap, LITERAL);
diff --git a/src/render.c b/src/render.c
index 50f03e6..9e59fa3 100644
--- a/src/render.c
+++ b/src/render.c
@@ -28,7 +28,7 @@ static void S_out(cmark_renderer *renderer, const char *source, bool wrap,
cmark_chunk remainder = cmark_chunk_literal("");
int k = renderer->buffer->size - 1;
- wrap = wrap && !renderer->no_wrap;
+ wrap = wrap && !renderer->no_linebreaks;
if (renderer->in_tight_list_item && renderer->need_cr > 1) {
renderer->need_cr = 1;
diff --git a/src/render.h b/src/render.h
index 479936a..c3acf6b 100644
--- a/src/render.h
+++ b/src/render.h
@@ -20,7 +20,7 @@ struct cmark_renderer {
bufsize_t last_breakable;
bool begin_line;
bool begin_content;
- bool no_wrap;
+ bool no_linebreaks;
bool in_tight_list_item;
void (*outc)(struct cmark_renderer *, cmark_escaping, int32_t, unsigned char);
void (*cr)(struct cmark_renderer *);