diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2015-03-21 21:13:36 -0700 | 
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2015-03-21 21:30:39 -0700 | 
| commit | 573dd81575b821661fb4aaa6f8c68b513f889f07 (patch) | |
| tree | b638bf7d789dc19bfd101caf887faecc4c1fbd78 /src/commonmark.c | |
| parent | b31224fbe2072b8e2328c9607e8587e79a7f307d (diff) | |
CommonMark renderer:  Added 'width' parameter.
This controls column width for hard wrapping.  By default it is
0, which means that no wrapping will be done.
Added a width parameter in `cmark_render_commonmark`.
Diffstat (limited to 'src/commonmark.c')
| -rw-r--r-- | src/commonmark.c | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/src/commonmark.c b/src/commonmark.c index 654afc3..98fef5e 100644 --- a/src/commonmark.c +++ b/src/commonmark.c @@ -381,14 +381,13 @@ S_render_node(cmark_node *node, cmark_event_type ev_type,  	return 1;  } -// TODO parameter for wrap width or 0 for no wrap -char *cmark_render_commonmark(cmark_node *root, int options) +char *cmark_render_commonmark(cmark_node *root, int options, int width)  {  	char *result;  	cmark_strbuf commonmark = GH_BUF_INIT;  	cmark_strbuf prefix = GH_BUF_INIT;  	struct render_state state = -		{ &commonmark, &prefix, 0, 65, 0, 0, true, false }; +		{ &commonmark, &prefix, 0, width, 0, 0, true, false };  	cmark_node *cur;  	cmark_event_type ev_type;  	cmark_iter *iter = cmark_iter_new(root); | 
