summaryrefslogtreecommitdiff
path: root/src/man.c
AgeCommit message (Collapse)Author
2016-01-18Merge branch 'master' of https://github.com/mbenelli/cmark into mbenelli-masterJohn MacFarlane
2015-12-28Rename NODE_HTML -> NODE_HTML_BLOCK, NODE_INLINE_HTML -> NODE_HTML_INLINE.John MacFarlane
API change. Sorry, but this is the time to break things, before 1.0 is released. This matches the recent changes to CommonMark.dtd.
2015-12-22Rename hrule -> thematic_break.John MacFarlane
CMARK_NODE_HRULE -> CMARK_NODE_THEMATIC_BREAK. However we've defined the former as the latter to keep backwards compatibility. See jgm/CommonMark 8fa94cb460f5e516b0e57adca33f50a669d51f6c
2015-12-22CMARK_NODE_HEADER -> CMARK_NODE_HEADING.John MacFarlane
Defined CMARK_NODE_HEADER to CMARK_NODE_HEADING to ease the transition.
2015-12-22Rename 'header' -> 'heading'.John MacFarlane
See jgm/CommonMark commit 0cdbcee4e840abd0ac7db93797b2b75ca4104314 Note that we have defined cmark_node_get_header_level = cmark_node_get_heading_level and cmark_node_set_header_level = camrk_node_set_heading_level for backwards compatibility in the API.
2015-12-19Changed API for CUSTOM_BLOCK and CUSTOM_INLINE.John MacFarlane
Instead of using their `as.literal` content, we now give each custom node *two* literal fields, one to be printed on entering the node (before rendering the children, if any), the other on exiting (after rendering children). This gives us the flexibility to have custom nodes with children.
2015-12-19Rename RAW_BLOCK -> CUSTOM_BLOCK, RAW_INLINE -> CUSTOM_INLINE.John MacFarlane
2015-12-19Added RAW_BLOCK and RAW_INLINE node types.John MacFarlane
These are passed through verbatim by all writers, with no escaping. They are never generated by the parser, and do not correspond to CommonMark elements. They are designed to be inserted by filters that postprocess the AST. For example, a filter might convert specially marked code blocks to svg diagrams in HTML and tikz diagrams in LaTeX, passing these through to the renderer as a RAW_BLOCK.
2015-11-02Replaced sprintf with snprintf.Marco Benelli
2015-07-27Use clang-format, llvm style, for formatting.John MacFarlane
* Reformatted all source files. * Added 'format' target to Makefile. * Removed 'astyle' target. * Updated .editorconfig.
2015-07-14astyle reformatting.John MacFarlane
2015-07-12Small cleanups.John MacFarlane
Moved begin_line setting into render.c, so you don't need to worry about it in outc.
2015-07-12Added cmark_render_code_point.John MacFarlane
2015-07-12man renderer: Use ASCII not LIT in outc.John MacFarlane
2015-07-12man renderer: Fixed character escaping, use new cmark_render_ascii.John MacFarlane
2015-07-12Added width parameter to render_man.John MacFarlane
Rewrote man.c using new renderer framework.
2015-04-15Check return status of utf8proc_iterate. Closes #27.John MacFarlane
If unicode parsing gives an error condition, we just skip the rest of the string without rendering anything and proceed. I'm not sure if that's the best way to handle this, but garbage in, garbage out. Note: this bug was found using american fuzzy lop.
2015-03-03astyle changes.John MacFarlane
2015-02-16Made 'options' an int rather than a long.John MacFarlane
For consistency with the API.
2015-02-15Fixed man escaping for unicode characters.John MacFarlane
2015-02-15Proper escaping of smart punctuation in man writer.John MacFarlane
2015-02-15Moved handling of --smart from renderer to parser.John MacFarlane
This allows backslash escapes to disable smart quote transformations in particular cases. Closes #8.
2015-02-15Implemented --smart for man output.John MacFarlane
2015-01-21Removed unnecessary strbuf_free's.John MacFarlane
2015-01-19Man writer: ensure we properly escape multiline strings.John MacFarlane
2015-01-05Reformatted code consistently with astyle.John MacFarlane
2014-12-31Remove useless void* castNick Wellnhofer
2014-12-30Revert "man: use a variable to store the char * from node_get_url."John MacFarlane
This reverts commit 46b67b710788be7924b5a412ab68eea3cac0cd96. I was mistaken that this helped. Which is good, because I would not have understood why it helped.
2014-12-30man: use a variable to store the char * from node_get_url.John MacFarlane
We get segfaults on some platforms when we do cmark_strbuf_printf(man, " (%s)", cmark_node_get_url(node)); but they go away with: url = cmark_node_get_url(node); cmark_strbuf_printf(man, " (%s)", url); I don't understand why. Closes #253.
2014-12-29Avoid warning about unused options parameter in man writer.John MacFarlane
2014-12-29Added options parameter to renderers.John MacFarlane
To keep the API simple and avoid API changes when new options are added, this is just a long integer. Set it by disjoining options that are defined as powers of 2: e.g. `CMARK_HTML_SOURCEPOS | CMARK_HTML_HARDREAKS`. Test options using `&`: `if (options & CMARK_HTML_SOURCEPOS)`. Added `--hardbreaks` and `--sourcepos` command-line options.
2014-12-28Rename CMARK_NODE_LIST_ITEM -> CMARK_NODE_ITEM.John MacFarlane
2014-12-16Added 'literal' field to 'code' struct.John MacFarlane
In the last few commits we were using as.code.fenced and as.literal at the same time for NODE_CODE_BLOCK, which obviously led to problems.
2014-12-15Re-added cmark_ prefix to strbuf and chunk.John MacFarlane
Reverts 225d720.
2014-12-14man writer: use chunk literal in code blocks.John MacFarlane
2014-12-14Added empty clauses for DOCUMENT node to html and man writers.John MacFarlane
For completeness.
2014-12-14Rename CMARK_NODE_INLINE_CODE -> CMARK_NODE_CODE.John MacFarlane
2014-12-13Added cmark_render_man (man page writer).John MacFarlane
cmark: Replaced `--man` and `--ast` with generic `--to` option.