cmark
My personal build of CMark ✏️
- Commit
- 60bd289c18e06e199260ee374ef29e3017bc4a90
- Parent
- be020e1928f2d0750573730483dd4cb40140935a
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
renderer: no_linebreaks instead of no_wrap.
We generally want this option to prohibit any breaking
in things like headers (not just wraps, but softbreaks).
Diffstat
3 files changed, 8 insertions, 6 deletions
diff --git 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);