Markdown parser C library
MD4C Readme
MD4C stands for "Markdown for C" and that's exactly what this project is about.
What is Markdown
In short, Markdown is the markup language this README.md
file is written in.
The following resources can explain more if you are unfamiliar with it:
What is MD4C
MD4C is Markdown parser implementation in C, with the following features:
Reviews
Builds
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_18_libc++-static_O3 |
timestamp |
2024-10-15 06:17:47 UTC (15:53 minutes ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_18_libc++ |
timestamp |
2024-10-15 06:17:15 UTC (16:25 minutes ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_18_libc++-O3 |
timestamp |
2024-10-15 06:16:43 UTC (16:57 minutes ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_18-O3 |
timestamp |
2024-10-15 06:16:10 UTC (17:30 minutes ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_18-static_O3 |
timestamp |
2024-10-15 06:12:12 UTC (21:27 minutes ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_18 |
timestamp |
2024-10-15 06:11:29 UTC (22:10 minutes ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_fedora_39-gcc_13-bindist |
timestamp |
2024-10-15 00:12:36 UTC (06:21:03 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin23.5.0 |
tgt config |
macos_14-gcc_14_homebrew-static_O3 |
timestamp |
2024-10-14 23:56:49 UTC (06:36:50 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin23.5.0 |
tgt config |
macos_14-gcc_14_homebrew-O3 |
timestamp |
2024-10-14 23:55:12 UTC (06:38:28 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin23.5.0 |
tgt config |
macos_14-gcc_14_homebrew |
timestamp |
2024-10-14 23:53:39 UTC (06:40:00 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_18_libc++ |
timestamp |
2024-10-14 21:42:50 UTC (08:50:49 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_18_libc++-static_O3 |
timestamp |
2024-10-14 21:42:40 UTC (08:50:59 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_18_libc++-O3 |
timestamp |
2024-10-14 21:42:13 UTC (08:51:26 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_18-O3 |
timestamp |
2024-10-14 21:41:59 UTC (08:51:40 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_18-static_O3 |
timestamp |
2024-10-14 21:41:34 UTC (08:52:05 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_18 |
timestamp |
2024-10-14 21:41:25 UTC (08:52:14 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin22.5.0 |
tgt config |
macos_13-clang_15.0 |
timestamp |
2024-10-14 19:57:05 UTC (10:36:34 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_18_llvm_msvc_17.10-static_O2 |
timestamp |
2024-10-14 19:53:01 UTC (10:40:39 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_12-bindist |
timestamp |
2024-10-14 19:52:16 UTC (10:41:24 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_13.2_mingw_w64-O2 |
timestamp |
2024-10-14 19:52:14 UTC (10:41:25 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_18_llvm_msvc_17.10-O2 |
timestamp |
2024-10-14 19:51:13 UTC (10:42:26 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_13.2_mingw_w64-static_O2 |
timestamp |
2024-10-14 19:51:03 UTC (10:42:36 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_17_msvc_msvc_17.10 |
timestamp |
2024-10-14 19:50:34 UTC (10:43:06 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-w64-mingw32 |
tgt config |
windows_10-gcc_13.2_mingw_w64 |
timestamp |
2024-10-14 19:49:55 UTC (10:43:45 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_14-ndebug_O3 |
timestamp |
2024-10-14 19:49:35 UTC (10:44:04 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-clang_18_llvm_msvc_17.10 |
timestamp |
2024-10-14 19:49:30 UTC (10:44:10 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_ubuntu_24.04-gcc_13-bindist |
timestamp |
2024-10-14 19:48:34 UTC (10:45:05 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_14-static_O3 |
timestamp |
2024-10-14 19:48:20 UTC (10:45:19 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_14-O3 |
timestamp |
2024-10-14 19:48:08 UTC (10:45:32 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_14 |
timestamp |
2024-10-14 19:47:44 UTC (10:45:55 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-freebsd14.1 |
tgt config |
freebsd_14-clang_18-static_O3 |
timestamp |
2024-10-14 19:47:36 UTC (10:46:03 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_17_libc++ |
timestamp |
2024-10-14 19:47:13 UTC (10:46:26 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-gcc_13.1 |
timestamp |
2024-10-14 19:47:06 UTC (10:46:34 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-freebsd13.3 |
tgt config |
freebsd_13-clang_17 |
timestamp |
2024-10-14 19:46:38 UTC (10:47:01 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-freebsd14.1 |
tgt config |
freebsd_14-clang_18-O3 |
timestamp |
2024-10-14 19:45:49 UTC (10:47:51 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-freebsd14.1 |
tgt config |
freebsd_14-clang_18 |
timestamp |
2024-10-14 19:45:13 UTC (10:48:27 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_debian_12-clang_17 |
timestamp |
2024-10-14 19:43:45 UTC (10:49:54 hours ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_14-ndebug_O3 |
timestamp |
2024-10-13 23:25:30 UTC (01 07:08:10 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_14-static_O3 |
timestamp |
2024-10-13 23:25:23 UTC (01 07:08:16 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_14-O3 |
timestamp |
2024-10-13 23:24:52 UTC (01 07:08:47 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_14 |
timestamp |
2024-10-13 23:24:19 UTC (01 07:09:20 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.10-static_O2 |
timestamp |
2024-10-13 12:16:11 UTC (01 18:17:28 days ago) |
result |
warning (update) | warning (test-installed) | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.10-O2 |
timestamp |
2024-10-13 12:15:46 UTC (01 18:17:53 days ago) |
result |
warning (update) | warning (test-installed) | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.8-static_O2 |
timestamp |
2024-10-13 12:15:28 UTC (01 18:18:11 days ago) |
result |
warning (update) | warning (test-installed) | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.10 |
timestamp |
2024-10-13 12:15:20 UTC (01 18:18:19 days ago) |
result |
warning (update) | warning (test-installed) | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.8-O2 |
timestamp |
2024-10-13 12:14:50 UTC (01 18:18:49 days ago) |
result |
warning (update) | warning (test-installed) | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-microsoft-win32-msvc14.3 |
tgt config |
windows_10-msvc_17.8 |
timestamp |
2024-10-13 12:14:40 UTC (01 18:19:00 days ago) |
result |
warning (update) | warning (test-installed) | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-linux-gnu |
tgt config |
linux_fedora_40-gcc_14-bindist |
timestamp |
2024-10-13 07:44:41 UTC (01 22:48:58 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-gcc_13 |
timestamp |
2024-10-13 04:23:30 UTC (02 02:10:09 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_17_libc++ |
timestamp |
2024-10-13 04:21:29 UTC (02 02:12:10 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
aarch64-linux-gnu |
tgt config |
linux_debian_12-clang_17 |
timestamp |
2024-10-13 04:20:57 UTC (02 02:12:42 days ago) |
result |
success | log | rebuild |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin23.5.0 |
tgt config |
macos_14-clang_15.0 |
result |
unbuilt |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin23.5.0 |
tgt config |
macos_14-clang_15.0-O3 |
result |
unbuilt |
toolchain |
public-0.17.0 |
target |
x86_64-apple-darwin23.5.0 |
tgt config |
macos_14-clang_15.0-static_O3 |
result |
unbuilt |
Changes
MD4C Change Log
Version 0.4.8
Fixes:
-
#149:
A HTML block started in a container block (and not explicitly finished in
the block) could eat 1 line of actual contents.
-
#150:
Fix md2html utility to output proper DOCTYPE and HTML tags when --full-html
command line options is used, accordingly to the expected output format
(HTML or XHTML).
-
#152:
Suppress recognition of a permissive autolink if it would otherwise form a
complete body of an outer inline link.
-
#153,
#154:
Set MD_BLOCK_UL_DETAIL::mark
and MD_BLOCK_OL_DETAIL::mark_delimiter
correctly, even when the blocks are nested at the same line in a complicated
ways.
-
#155:
Avoid reading 1 character beyond the input size in some complex cases.
Version 0.4.7
Changes:
- Add
MD_TABLE_DETAIL
structure into the API. The structure describes column
count and row count of the table, and pointer to it is passed into the
application-provided block callback with the MD_BLOCK_TABLE
block type.
Fixes:
-
#131:
Fix handling of a reference image nested in a reference link.
-
#135:
Handle unmatched parenthesis pairs inside a permissive URL and WWW auto-links
in a way more compatible with the GFM.
-
#138:
The tag <tbody></tbody>
is now suppressed whenever the table has zero body
rows.
-
#139:
Recognize a list item mark even when EOF follows it.
-
#142:
Fix reference link definition label matching in a case when the label ends
with a Unicode character with non-trivial case folding mapping.
Version 0.4.6
Fixes:
-
#130:
Fix ISANYOF
macro, which could provide unexpected results when encountering
zero byte in the input text; in some cases leading to broken internal state
of the parser.
The bug could result in denial of service and possibly also to other security
implications. Applications are advised to update to 0.4.6.
Version 0.4.5
Fixes:
-
#118:
Fix HTML renderer's MD_HTML_FLAG_VERBATIM_ENTITIES
flag, exposed in the
md2html
utility via --fverbatim-entities
.
-
#124:
Fix handling of indentation of 16 or more spaces in the fenced code blocks.
Version 0.4.4
Changes:
- Make Unicode-specific code compliant to Unicode 13.0.
New features:
-
The HTML renderer, developed originally as the heart of the md2html
utility, is now built as a standalone library, in order to simplify its
reuse in applications.
-
With MD_HTML_FLAG_SKIP_UTF8_BOM
, the HTML renderer now skips UTF-8 byte
order mark (BOM) if the input begins with it, before passing to the Markdown
parser.
md2html
utility automatically enables the flag (unless it is custom-built
with -DMD4C_USE_ASCII
).
-
With MD_HTML_FLAG_XHTML
, The HTML renderer generates XHTML instead of
HTML.
This effectively means <br />
instead of <br>
, <hr />
instead of
<hr>
, and <img ... />
instead of <img ...>
.
md2html
utility now understands the command line option -x
or --xhtml
enabling the XHTML mode.
Fixes:
-
#113:
Add missing folding info data for the following Unicode characters:
U+0184
, U+018a
, U+01b2
, U+01b5
, U+01f4
, U+0372
, U+038f
,
U+1c84
, U+1fb9
, U+1fbb
, U+1fd9
, U+1fdb
, U+1fe9
, U+1feb
,
U+1ff9
, U+1ffb
, U+2c7f
, U+2ced
, U+a77b
, U+a792
, U+a7c9
.
Due the bug, the link definition label matching did not work in the case
insensitive way for these characters.
Version 0.4.3
New features:
- With
MD_FLAG_UNDERLINE
, spans enclosed in underscore (_foo_
) are seen
as underline (MD_SPAN_UNDERLINE
) rather than an ordinary emphasis or
strong emphasis.
Changes:
-
The implementation of wiki-links extension (with MD_FLAG_WIKILINKS
) has
been simplified.
- A noticeable increase of MD4C's memory footprint introduced by the
extension implementation in 0.4.0 has been removed.
- The priority handling towards other inline elements have been unified.
(This affects an obscure case where syntax of an image was in place of
wiki-link destination made the wiki-link invalid. Now all inline spans
in the wiki-link destination, including the images, is suppressed.)
- The length limitation of 100 characters now always applies to wiki-link
destination.
-
Recognition of strike-through spans (with the flag MD_FLAG_STRIKETHROUGH
)
has become much stricter and, arguably, reasonable.
- Only single tildes (
~
) and double tildes (~~
) are recognized as
strike-through marks. Longer ones are not anymore.
- The length of the opener and closer marks have to be the same.
- The tildes cannot open a strike-through span if a whitespace follows.
- The tildes cannot close a strike-through span if a whitespace precedes.
This change follows the changes of behavior in cmark-gfm some time ago, so
it is also beneficial from compatibility point of view.
-
When building MD4C by hand instead of using its CMake-based build, the UTF-8
support was by default disabled, unless explicitly asked for by defining
a preprocessor macro MD4C_USE_UTF8
.
This has been changed and the UTF-8 mode now becomes the default, no matter
how md4c.c
is compiled. If you need to disable it and use the ASCII-only
mode, you have explicitly define macro MD4C_USE_ASCII
when compiling it.
(The CMake-based build as provided in our repository explicitly asked for
the UTF-8 support with -DMD4C_USE_UTF8
. I.e. if you are using MD4C library
built with our vanilla CMakeLists.txt
files, this change should not affect
you.)