aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-22 20:52:00 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-22 20:52:00 +0200
commit058aeef80e8a33d0e385f284b23eeb117f5ec547 (patch)
tree9a7a96b7cde32cf66b6202f32ace18335ecc9cdb /lib
parente9a0e392c6462712e6f02f3565b8a8cc1652952a (diff)
downloadkristall-058aeef80e8a33d0e385f284b23eeb117f5ec547.tar.gz
Includes cmark into build.
Diffstat (limited to 'lib')
-rw-r--r--lib/cmark/cmark.pri44
-rw-r--r--lib/cmark/man/man3/cmark.3271
-rw-r--r--lib/cmark/src/config.h18
3 files changed, 203 insertions, 130 deletions
diff --git a/lib/cmark/cmark.pri b/lib/cmark/cmark.pri
new file mode 100644
index 0000000..01aadfb
--- /dev/null
+++ b/lib/cmark/cmark.pri
@@ -0,0 +1,44 @@
+
+HEADERS += \
+ $$PWD/src/buffer.h \
+ $$PWD/src/chunk.h \
+ $$PWD/src/cmark.h \
+ $$PWD/src/config.h \
+ $$PWD/src/cmark_ctype.h \
+ $$PWD/src/config.h \
+ $$PWD/src/houdini.h \
+ $$PWD/src/inlines.h \
+ $$PWD/src/iterator.h \
+ $$PWD/src/node.h \
+ $$PWD/src/parser.h \
+ $$PWD/src/references.h \
+ $$PWD/src/render.h \
+ $$PWD/src/scanners.h \
+ $$PWD/src/utf8.h
+
+SOURCES += \
+ $$PWD/src/blocks.c \
+ $$PWD/src/buffer.c \
+ $$PWD/src/cmark.c \
+ $$PWD/src/cmark_ctype.c \
+ $$PWD/src/commonmark.c \
+ $$PWD/src/houdini_href_e.c \
+ $$PWD/src/houdini_html_e.c \
+ $$PWD/src/houdini_html_u.c \
+ $$PWD/src/inlines.c \
+ $$PWD/src/iterator.c \
+ $$PWD/src/node.c \
+ $$PWD/src/references.c \
+ $$PWD/src/render.c \
+ $$PWD/src/scanners.c \
+ $$PWD/src/utf8.c \
+ $$PWD/src/html.c \
+ $$PWD/src/xml.c
+
+INCLUDEPATH += $$PWD/src
+DEPENDPATH += $$PWD/src
+
+# exluded modules:
+# $$PWD/src/latex.c \
+# $$PWD/src/man.c \
+# -- reserved for HTML :)
diff --git a/lib/cmark/man/man3/cmark.3 b/lib/cmark/man/man3/cmark.3
index e460244..a4c68f6 100644
--- a/lib/cmark/man/man3/cmark.3
+++ b/lib/cmark/man/man3/cmark.3
@@ -1,4 +1,4 @@
-.TH cmark 3 "February 09, 2020" "LOCAL" "Library Functions Manual"
+.TH cmark 3 "June 22, 2020" "LOCAL" "Library Functions Manual"
.SH
NAME
.PP
@@ -13,9 +13,9 @@ Simple Interface
\fIchar *\f[] \fBcmark_markdown_to_html\f[](\fIconst char *text\f[], \fIsize_t len\f[], \fIint options\f[])
.PP
-Convert \f[I]text\f[] (assumed to be a UTF\-8 encoded string with length
-\f[I]len\f[]) from CommonMark Markdown to HTML, returning a
-null\-terminated, UTF\-8\-encoded string. It is the caller's
+Convert \f[I]text\f[] (assumed to be a UTF\-8 encoded string with
+length \f[I]len\f[]) from CommonMark Markdown to HTML, returning
+a null\-terminated, UTF\-8\-encoded string. It is the caller's
responsibility to free the returned buffer.
.SS
@@ -112,8 +112,8 @@ typedef struct cmark_mem {
.fi
.PP
-Defines the memory allocation functions to be used by CMark when parsing
-and allocating a document tree
+Defines the memory allocation functions to be used by CMark when
+parsing and allocating a document tree
.PP
\fIcmark_mem *\f[] \fBcmark_get_default_mem_allocator\f[](\fI\f[])
@@ -128,17 +128,18 @@ Creating and Destroying Nodes
\fIcmark_node *\f[] \fBcmark_node_new\f[](\fIcmark_node_type type\f[])
.PP
-Creates a new node of type \f[I]type\f[]. Note that the node may have
-other required properties, which it is the caller's responsibility to
-assign.
+Creates a new node of type \f[I]type\f[]. Note that the node may
+have other required properties, which it is the caller's
+responsibility to assign.
.PP
\fIcmark_node *\f[] \fBcmark_node_new_with_mem\f[](\fIcmark_node_type type\f[], \fIcmark_mem *mem\f[])
.PP
-Same as \f[C]cmark_node_new\f[], but explicitly listing the memory
-allocator used to allocate the node. Note: be sure to use the same
-allocator for every node in a tree, or bad things can happen.
+Same as \f[C]cmark_node_new\f[], but explicitly listing the
+memory allocator used to allocate the node. Note: be sure to use
+the same allocator for every node in a tree, or bad things can
+happen.
.PP
\fIvoid\f[] \fBcmark_node_free\f[](\fIcmark_node *node\f[])
@@ -153,15 +154,15 @@ Tree Traversal
\fIcmark_node *\f[] \fBcmark_node_next\f[](\fIcmark_node *node\f[])
.PP
-Returns the next node in the sequence after \f[I]node\f[], or NULL if
-there is none.
+Returns the next node in the sequence after \f[I]node\f[], or
+NULL if there is none.
.PP
\fIcmark_node *\f[] \fBcmark_node_previous\f[](\fIcmark_node *node\f[])
.PP
-Returns the previous node in the sequence after \f[I]node\f[], or NULL
-if there is none.
+Returns the previous node in the sequence after \f[I]node\f[], or
+NULL if there is none.
.PP
\fIcmark_node *\f[] \fBcmark_node_parent\f[](\fIcmark_node *node\f[])
@@ -173,31 +174,33 @@ Returns the parent of \f[I]node\f[], or NULL if there is none.
\fIcmark_node *\f[] \fBcmark_node_first_child\f[](\fIcmark_node *node\f[])
.PP
-Returns the first child of \f[I]node\f[], or NULL if \f[I]node\f[] has
-no children.
+Returns the first child of \f[I]node\f[], or NULL if
+\f[I]node\f[] has no children.
.PP
\fIcmark_node *\f[] \fBcmark_node_last_child\f[](\fIcmark_node *node\f[])
.PP
-Returns the last child of \f[I]node\f[], or NULL if \f[I]node\f[] has no
-children.
+Returns the last child of \f[I]node\f[], or NULL if \f[I]node\f[]
+has no children.
.SS
Iterator
.PP
-An iterator will walk through a tree of nodes, starting from a root
-node, returning one node at a time, together with information about
-whether the node is being entered or exited. The iterator will first
-descend to a child node, if there is one. When there is no child, the
-iterator will go to the next sibling. When there is no next sibling, the
-iterator will return to the parent (but with a \f[I]cmark_event_type\f[]
-of \f[C]CMARK_EVENT_EXIT\f[]). The iterator will return
-\f[C]CMARK_EVENT_DONE\f[] when it reaches the root node again. One
-natural application is an HTML renderer, where an \f[C]ENTER\f[] event
-outputs an open tag and an \f[C]EXIT\f[] event outputs a close tag. An
-iterator might also be used to transform an AST in some systematic way,
-for example, turning all level\-3 headings into regular paragraphs.
+An iterator will walk through a tree of nodes, starting from a
+root node, returning one node at a time, together with
+information about whether the node is being entered or exited.
+The iterator will first descend to a child node, if there is one.
+When there is no child, the iterator will go to the next sibling.
+When there is no next sibling, the iterator will return to the
+parent (but with a \f[I]cmark_event_type\f[] of
+\f[C]CMARK_EVENT_EXIT\f[]). The iterator will return
+\f[C]CMARK_EVENT_DONE\f[] when it reaches the root node again.
+One natural application is an HTML renderer, where an
+\f[C]ENTER\f[] event outputs an open tag and an \f[C]EXIT\f[]
+event outputs a close tag. An iterator might also be used to
+transform an AST in some systematic way, for example, turning all
+level\-3 headings into regular paragraphs.
.IP
.nf
\f[C]
@@ -216,8 +219,8 @@ usage_example(cmark_node *root) {
\f[]
.fi
.PP
-Iterators will never return \f[C]EXIT\f[] events for leaf nodes, which
-are nodes of type:
+Iterators will never return \f[C]EXIT\f[] events for leaf nodes,
+which are nodes of type:
.IP \[bu] 2
CMARK_NODE_HTML_BLOCK
.IP \[bu] 2
@@ -258,10 +261,11 @@ typedef enum {
\fIcmark_iter *\f[] \fBcmark_iter_new\f[](\fIcmark_node *root\f[])
.PP
-Creates a new iterator starting at \f[I]root\f[]. The current node and
-event type are undefined until \f[I]cmark_iter_next\f[] is called for
-the first time. The memory allocated for the iterator should be released
-using \f[I]cmark_iter_free\f[] when it is no longer needed.
+Creates a new iterator starting at \f[I]root\f[]. The current
+node and event type are undefined until \f[I]cmark_iter_next\f[]
+is called for the first time. The memory allocated for the
+iterator should be released using \f[I]cmark_iter_free\f[] when
+it is no longer needed.
.PP
\fIvoid\f[] \fBcmark_iter_free\f[](\fIcmark_iter *iter\f[])
@@ -299,9 +303,9 @@ Returns the root node.
\fIvoid\f[] \fBcmark_iter_reset\f[](\fIcmark_iter *iter\f[], \fIcmark_node *current\f[], \fIcmark_event_type event_type\f[])
.PP
-Resets the iterator so that the current node is \f[I]current\f[] and the
-event type is \f[I]event_type\f[]. The new current node must be a
-descendant of the root node or the root node itself.
+Resets the iterator so that the current node is \f[I]current\f[]
+and the event type is \f[I]event_type\f[]. The new current node
+must be a descendant of the root node or the root node itself.
.SS
Accessors
@@ -316,64 +320,65 @@ Returns the user data of \f[I]node\f[].
\fIint\f[] \fBcmark_node_set_user_data\f[](\fIcmark_node *node\f[], \fIvoid *user_data\f[])
.PP
-Sets arbitrary user data for \f[I]node\f[]. Returns 1 on success, 0 on
-failure.
+Sets arbitrary user data for \f[I]node\f[]. Returns 1 on success,
+0 on failure.
.PP
\fIcmark_node_type\f[] \fBcmark_node_get_type\f[](\fIcmark_node *node\f[])
.PP
-Returns the type of \f[I]node\f[], or \f[C]CMARK_NODE_NONE\f[] on error.
+Returns the type of \f[I]node\f[], or \f[C]CMARK_NODE_NONE\f[] on
+error.
.PP
\fIconst char *\f[] \fBcmark_node_get_type_string\f[](\fIcmark_node *node\f[])
.PP
-Like \f[I]cmark_node_get_type\f[], but returns a string representation
-of the type, or \f[C]"<unknown>"\f[].
+Like \f[I]cmark_node_get_type\f[], but returns a string
+representation of the type, or \f[C]"<unknown>"\f[].
.PP
\fIconst char *\f[] \fBcmark_node_get_literal\f[](\fIcmark_node *node\f[])
.PP
-Returns the string contents of \f[I]node\f[], or an empty string if none
-is set. Returns NULL if called on a node that does not have string
-content.
+Returns the string contents of \f[I]node\f[], or an empty string
+if none is set. Returns NULL if called on a node that does not
+have string content.
.PP
\fIint\f[] \fBcmark_node_set_literal\f[](\fIcmark_node *node\f[], \fIconst char *content\f[])
.PP
-Sets the string contents of \f[I]node\f[]. Returns 1 on success, 0 on
-failure.
+Sets the string contents of \f[I]node\f[]. Returns 1 on success,
+0 on failure.
.PP
\fIint\f[] \fBcmark_node_get_heading_level\f[](\fIcmark_node *node\f[])
.PP
-Returns the heading level of \f[I]node\f[], or 0 if \f[I]node\f[] is not
-a heading.
+Returns the heading level of \f[I]node\f[], or 0 if \f[I]node\f[]
+is not a heading.
.PP
\fIint\f[] \fBcmark_node_set_heading_level\f[](\fIcmark_node *node\f[], \fIint level\f[])
.PP
-Sets the heading level of \f[I]node\f[], returning 1 on success and 0 on
-error.
+Sets the heading level of \f[I]node\f[], returning 1 on success
+and 0 on error.
.PP
\fIcmark_list_type\f[] \fBcmark_node_get_list_type\f[](\fIcmark_node *node\f[])
.PP
-Returns the list type of \f[I]node\f[], or \f[C]CMARK_NO_LIST\f[] if
-\f[I]node\f[] is not a list.
+Returns the list type of \f[I]node\f[], or \f[C]CMARK_NO_LIST\f[]
+if \f[I]node\f[] is not a list.
.PP
\fIint\f[] \fBcmark_node_set_list_type\f[](\fIcmark_node *node\f[], \fIcmark_list_type type\f[])
.PP
-Sets the list type of \f[I]node\f[], returning 1 on success and 0 on
-error.
+Sets the list type of \f[I]node\f[], returning 1 on success and 0
+on error.
.PP
\fIcmark_delim_type\f[] \fBcmark_node_get_list_delim\f[](\fIcmark_node *node\f[])
@@ -386,15 +391,15 @@ Returns the list delimiter type of \f[I]node\f[], or
\fIint\f[] \fBcmark_node_set_list_delim\f[](\fIcmark_node *node\f[], \fIcmark_delim_type delim\f[])
.PP
-Sets the list delimiter type of \f[I]node\f[], returning 1 on success
-and 0 on error.
+Sets the list delimiter type of \f[I]node\f[], returning 1 on
+success and 0 on error.
.PP
\fIint\f[] \fBcmark_node_get_list_start\f[](\fIcmark_node *node\f[])
.PP
-Returns starting number of \f[I]node\f[], if it is an ordered list,
-otherwise 0.
+Returns starting number of \f[I]node\f[], if it is an ordered
+list, otherwise 0.
.PP
\fIint\f[] \fBcmark_node_set_list_start\f[](\fIcmark_node *node\f[], \fIint start\f[])
@@ -413,7 +418,8 @@ Returns 1 if \f[I]node\f[] is a tight list, 0 otherwise.
\fIint\f[] \fBcmark_node_set_list_tight\f[](\fIcmark_node *node\f[], \fIint tight\f[])
.PP
-Sets the "tightness" of a list. Returns 1 on success, 0 on failure.
+Sets the "tightness" of a list. Returns 1 on success, 0 on
+failure.
.PP
\fIconst char *\f[] \fBcmark_node_get_fence_info\f[](\fIcmark_node *node\f[])
@@ -425,70 +431,70 @@ Returns the info string from a fenced code block.
\fIint\f[] \fBcmark_node_set_fence_info\f[](\fIcmark_node *node\f[], \fIconst char *info\f[])
.PP
-Sets the info string in a fenced code block, returning 1 on success
-and 0 on failure.
+Sets the info string in a fenced code block, returning 1 on
+success and 0 on failure.
.PP
\fIconst char *\f[] \fBcmark_node_get_url\f[](\fIcmark_node *node\f[])
.PP
-Returns the URL of a link or image \f[I]node\f[], or an empty string if
-no URL is set. Returns NULL if called on a node that is not a link or
-image.
+Returns the URL of a link or image \f[I]node\f[], or an empty
+string if no URL is set. Returns NULL if called on a node that is
+not a link or image.
.PP
\fIint\f[] \fBcmark_node_set_url\f[](\fIcmark_node *node\f[], \fIconst char *url\f[])
.PP
-Sets the URL of a link or image \f[I]node\f[]. Returns 1 on success, 0
-on failure.
+Sets the URL of a link or image \f[I]node\f[]. Returns 1 on
+success, 0 on failure.
.PP
\fIconst char *\f[] \fBcmark_node_get_title\f[](\fIcmark_node *node\f[])
.PP
-Returns the title of a link or image \f[I]node\f[], or an empty string
-if no title is set. Returns NULL if called on a node that is not a link
-or image.
+Returns the title of a link or image \f[I]node\f[], or an empty
+string if no title is set. Returns NULL if called on a node that
+is not a link or image.
.PP
\fIint\f[] \fBcmark_node_set_title\f[](\fIcmark_node *node\f[], \fIconst char *title\f[])
.PP
-Sets the title of a link or image \f[I]node\f[]. Returns 1 on success, 0
-on failure.
+Sets the title of a link or image \f[I]node\f[]. Returns 1 on
+success, 0 on failure.
.PP
\fIconst char *\f[] \fBcmark_node_get_on_enter\f[](\fIcmark_node *node\f[])
.PP
-Returns the literal "on enter" text for a custom \f[I]node\f[], or an
-empty string if no on_enter is set. Returns NULL if called on a
-non\-custom node.
+Returns the literal "on enter" text for a custom \f[I]node\f[],
+or an empty string if no on_enter is set. Returns NULL if called
+on a non\-custom node.
.PP
\fIint\f[] \fBcmark_node_set_on_enter\f[](\fIcmark_node *node\f[], \fIconst char *on_enter\f[])
.PP
-Sets the literal text to render "on enter" for a custom \f[I]node\f[].
-Any children of the node will be rendered after this text. Returns 1 on
-success 0 on failure.
+Sets the literal text to render "on enter" for a custom
+\f[I]node\f[]. Any children of the node will be rendered after
+this text. Returns 1 on success 0 on failure.
.PP
\fIconst char *\f[] \fBcmark_node_get_on_exit\f[](\fIcmark_node *node\f[])
.PP
-Returns the literal "on exit" text for a custom \f[I]node\f[], or an
-empty string if no on_exit is set. Returns NULL if called on a
+Returns the literal "on exit" text for a custom \f[I]node\f[], or
+an empty string if no on_exit is set. Returns NULL if called on a
non\-custom node.
.PP
\fIint\f[] \fBcmark_node_set_on_exit\f[](\fIcmark_node *node\f[], \fIconst char *on_exit\f[])
.PP
-Sets the literal text to render "on exit" for a custom \f[I]node\f[].
-Any children of the node will be rendered before this text. Returns 1 on
-success 0 on failure.
+Sets the literal text to render "on exit" for a custom
+\f[I]node\f[]. Any children of the node will be rendered before
+this text. Returns 1 on success 0 on failure.
.PP
\fIint\f[] \fBcmark_node_get_start_line\f[](\fIcmark_node *node\f[])
@@ -521,37 +527,37 @@ Tree Manipulation
\fIvoid\f[] \fBcmark_node_unlink\f[](\fIcmark_node *node\f[])
.PP
-Unlinks a \f[I]node\f[], removing it from the tree, but not freeing its
-memory. (Use \f[I]cmark_node_free\f[] for that.)
+Unlinks a \f[I]node\f[], removing it from the tree, but not
+freeing its memory. (Use \f[I]cmark_node_free\f[] for that.)
.PP
\fIint\f[] \fBcmark_node_insert_before\f[](\fIcmark_node *node\f[], \fIcmark_node *sibling\f[])
.PP
-Inserts \f[I]sibling\f[] before \f[I]node\f[]. Returns 1 on success, 0
-on failure.
+Inserts \f[I]sibling\f[] before \f[I]node\f[]. Returns 1 on
+success, 0 on failure.
.PP
\fIint\f[] \fBcmark_node_insert_after\f[](\fIcmark_node *node\f[], \fIcmark_node *sibling\f[])
.PP
-Inserts \f[I]sibling\f[] after \f[I]node\f[]. Returns 1 on success, 0 on
-failure.
+Inserts \f[I]sibling\f[] after \f[I]node\f[]. Returns 1 on
+success, 0 on failure.
.PP
\fIint\f[] \fBcmark_node_replace\f[](\fIcmark_node *oldnode\f[], \fIcmark_node *newnode\f[])
.PP
Replaces \f[I]oldnode\f[] with \f[I]newnode\f[] and unlinks
-\f[I]oldnode\f[] (but does not free its memory). Returns 1 on success, 0
-on failure.
+\f[I]oldnode\f[] (but does not free its memory). Returns 1 on
+success, 0 on failure.
.PP
\fIint\f[] \fBcmark_node_prepend_child\f[](\fIcmark_node *node\f[], \fIcmark_node *child\f[])
.PP
-Adds \f[I]child\f[] to the beginning of the children of \f[I]node\f[].
-Returns 1 on success, 0 on failure.
+Adds \f[I]child\f[] to the beginning of the children of
+\f[I]node\f[]. Returns 1 on success, 0 on failure.
.PP
\fIint\f[] \fBcmark_node_append_child\f[](\fIcmark_node *node\f[], \fIcmark_node *child\f[])
@@ -629,18 +635,19 @@ Finish parsing and return a pointer to a tree of nodes.
\fIcmark_node *\f[] \fBcmark_parse_document\f[](\fIconst char *buffer\f[], \fIsize_t len\f[], \fIint options\f[])
.PP
-Parse a CommonMark document in \f[I]buffer\f[] of length \f[I]len\f[].
-Returns a pointer to a tree of nodes. The memory allocated for the node
-tree should be released using \f[I]cmark_node_free\f[] when it is no
-longer needed.
+Parse a CommonMark document in \f[I]buffer\f[] of length
+\f[I]len\f[]. Returns a pointer to a tree of nodes. The memory
+allocated for the node tree should be released using
+\f[I]cmark_node_free\f[] when it is no longer needed.
.PP
\fIcmark_node *\f[] \fBcmark_parse_file\f[](\fIFILE *f\f[], \fIint options\f[])
.PP
-Parse a CommonMark document in file \f[I]f\f[], returning a pointer to a
-tree of nodes. The memory allocated for the node tree should be released
-using \f[I]cmark_node_free\f[] when it is no longer needed.
+Parse a CommonMark document in file \f[I]f\f[], returning a
+pointer to a tree of nodes. The memory allocated for the node
+tree should be released using \f[I]cmark_node_free\f[] when it is
+no longer needed.
.SS
Rendering
@@ -649,37 +656,38 @@ Rendering
\fIchar *\f[] \fBcmark_render_xml\f[](\fIcmark_node *root\f[], \fIint options\f[])
.PP
-Render a \f[I]node\f[] tree as XML. It is the caller's responsibility to
-free the returned buffer.
+Render a \f[I]node\f[] tree as XML. It is the caller's
+responsibility to free the returned buffer.
.PP
\fIchar *\f[] \fBcmark_render_html\f[](\fIcmark_node *root\f[], \fIint options\f[])
.PP
-Render a \f[I]node\f[] tree as an HTML fragment. It is up to the user to
-add an appropriate header and footer. It is the caller's responsibility
-to free the returned buffer.
+Render a \f[I]node\f[] tree as an HTML fragment. It is up to the
+user to add an appropriate header and footer. It is the caller's
+responsibility to free the returned buffer.
.PP
\fIchar *\f[] \fBcmark_render_man\f[](\fIcmark_node *root\f[], \fIint options\f[], \fIint width\f[])
.PP
-Render a \f[I]node\f[] tree as a groff man page, without the header. It
-is the caller's responsibility to free the returned buffer.
+Render a \f[I]node\f[] tree as a groff man page, without the
+header. It is the caller's responsibility to free the returned
+buffer.
.PP
\fIchar *\f[] \fBcmark_render_commonmark\f[](\fIcmark_node *root\f[], \fIint options\f[], \fIint width\f[])
.PP
-Render a \f[I]node\f[] tree as a commonmark document. It is the caller's
-responsibility to free the returned buffer.
+Render a \f[I]node\f[] tree as a commonmark document. It is the
+caller's responsibility to free the returned buffer.
.PP
\fIchar *\f[] \fBcmark_render_latex\f[](\fIcmark_node *root\f[], \fIint options\f[], \fIint width\f[])
.PP
-Render a \f[I]node\f[] tree as a LaTeX document. It is the caller's
-responsibility to free the returned buffer.
+Render a \f[I]node\f[] tree as a LaTeX document. It is the
+caller's responsibility to free the returned buffer.
.SS
Options
@@ -709,7 +717,8 @@ Options affecting rendering
.fi
.PP
-Include a \f[C]data\-sourcepos\f[] attribute on all block elements.
+Include a \f[C]data\-sourcepos\f[] attribute on all block
+elements.
.PP
.nf
@@ -733,9 +742,9 @@ Render \f[C]softbreak\f[] elements as hard line breaks.
.fi
.PP
-\f[C]CMARK_OPT_SAFE\f[] is defined here for API compatibility, but it no
-longer has any effect. "Safe" mode is now the default: set
-\f[C]CMARK_OPT_UNSAFE\f[] to disable it.
+\f[C]CMARK_OPT_SAFE\f[] is defined here for API compatibility,
+but it no longer has any effect. "Safe" mode is now the default:
+set \f[C]CMARK_OPT_UNSAFE\f[] to disable it.
.PP
.nf
@@ -748,10 +757,11 @@ longer has any effect. "Safe" mode is now the default: set
.PP
Render raw HTML and unsafe links (\f[C]javascript:\f[],
-\f[C]vbscript:\f[], \f[C]file:\f[], and \f[C]data:\f[], except for
-\f[C]image/png\f[], \f[C]image/gif\f[], \f[C]image/jpeg\f[], or
-\f[C]image/webp\f[] mime types). By default, raw HTML is replaced by a
-placeholder HTML comment. Unsafe links are replaced by empty strings.
+\f[C]vbscript:\f[], \f[C]file:\f[], and \f[C]data:\f[], except
+for \f[C]image/png\f[], \f[C]image/gif\f[], \f[C]image/jpeg\f[],
+or \f[C]image/webp\f[] mime types). By default, raw HTML is
+replaced by a placeholder HTML comment. Unsafe links are replaced
+by empty strings.
.PP
.nf
@@ -790,8 +800,8 @@ Legacy option (no effect).
.fi
.PP
-Validate UTF\-8 in the input before parsing, replacing illegal sequences
-with the replacement character U+FFFD.
+Validate UTF\-8 in the input before parsing, replacing illegal
+sequences with the replacement character U+FFFD.
.PP
.nf
@@ -813,8 +823,8 @@ Version information
\fIint\f[] \fBcmark_version\f[](\fIvoid\f[])
.PP
-The library version as integer for runtime checks. Also available as
-macro CMARK_VERSION for compile time checks.
+The library version as integer for runtime checks. Also available
+as macro CMARK_VERSION for compile time checks.
.IP \[bu] 2
Bits 16\-23 contain the major version.
.IP \[bu] 2
@@ -822,14 +832,15 @@ Bits 8\-15 contain the minor version.
.IP \[bu] 2
Bits 0\-7 contain the patchlevel.
.PP
-In hexadecimal format, the number 0x010203 represents version 1.2.3.
+In hexadecimal format, the number 0x010203 represents
+version 1.2.3.
.PP
\fIconst char *\f[] \fBcmark_version_string\f[](\fIvoid\f[])
.PP
-The library version string for runtime checks. Also available as macro
-CMARK_VERSION_STRING for compile time checks.
+The library version string for runtime checks. Also available as
+macro CMARK_VERSION_STRING for compile time checks.
.SH
AUTHORS
diff --git a/lib/cmark/src/config.h b/lib/cmark/src/config.h
new file mode 100644
index 0000000..a24e790
--- /dev/null
+++ b/lib/cmark/src/config.h
@@ -0,0 +1,18 @@
+#ifndef CMARK_CONFIG_H
+#define CMARK_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdbool.h>
+
+#define HAVE___BUILTIN_EXPECT
+#define CMARK_ATTRIBUTE(list) __attribute__ (list)
+#define CMARK_INLINE inline
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif