Martin Mitas
90f8d9646f
Put all compiler option to one place and unify them for all targets.
...
(And fix a newly triggered warning in md2html/md2html.c.)
2024-01-28 08:26:39 +01:00
Martin Mitas
4933a89317
md2html: Add <meta charset="UTF-8"> with output with --full-html.
...
Fixes #231 .
2024-01-25 20:28:54 +01:00
Martin Mitas
f46000c7fc
Use UTF-8 in copyright notes.
2024-01-24 09:49:59 +01:00
Martin Mitas
533b833121
md2html/cmdline.[ch]: Update from upstream.
2024-01-24 09:48:53 +01:00
Martin Mitas
2ba5e2c660
Make --replay-fuzz friendlier to work with in debugger.
...
We make effectively input zero-terminated so debugger doesn't attempt to
write more than what's really provided.
2024-01-17 14:48:57 +01:00
Martin Mitas
4a64fee2ee
Bump copyright years.
2024-01-11 13:12:55 +01:00
Martin Mitas
338e0bb2fb
md2html: Add undoc'ed debug option --replay-fuzz.
...
This helps to reproduce issues found by oss-fuzz project.
2024-01-10 17:30:51 +01:00
Andreas Baumann
47a2ad3d93
added options --html-title and --html-css ( #188 )
2024-01-09 11:34:40 +01:00
l-m
6ef3be6e69
MD_FLAG_HARD_SOFT_BREAKS
(#193 )
2024-01-08 21:09:57 +01:00
Martin Mitas
a470fbf8c3
md2html: Change interpretation of --github and --commonmark options.
...
Previously these assigned a set of parser flags with an operator '='.
Now '|=' is used so that any preceding options affecting what extensions
to allow are not ignored.
2022-01-13 20:34:47 +01:00
Martin Mitas
ea188729d8
Emit '\n' after the XHTML root tag.
...
Fixes #163 .
2021-07-15 18:58:39 +02:00
Kai Koehne
e828594220
Fix MSVC compiler level 3 warnings ( #162 )
...
Fix various C4244 warnings with the MSVC compiler for 64 bit
2021-06-14 09:47:17 +02:00
Martin Mitas
269bbdb31b
Fix output with --full-html command line options.
...
Fixes #150 .
2021-02-11 21:46:33 +01:00
Martin Mitas
ddcc1f34df
HTML renderer: Add support for XHTML mode.
2020-05-04 12:54:15 +02:00
Martin Mitas
2728b9eb0f
Move md2html utility to a standalone dir.
2020-04-20 19:37:18 +02:00
Martin Mitas
7f2d880f9a
Refactor dir structure.
...
We place all the sources in the single directory in order to not having
many dirs with too few sources.
2020-04-20 19:22:42 +02:00
Martin Mitas
d0e3ed79bf
md2html: Skip UTF-8 BOM, if present in the input.
2020-03-12 23:08:29 +01:00
Martin Mitas
e33bb733bb
md2html: Migrate to cmdline.[hc] from C-Reusables.
...
This fixes many warnings from gcc 9.2.
2020-03-02 15:34:24 +01:00
Martin Mitas
df58278539
travis CI: Enforce -std=c89.
...
Also fix all related warnings and errors. This should help Qt team which
needs to build MD4C with Integrity compiler for some embedded platforms.
2020-02-12 22:23:56 +01:00
Martin Mitas
af1c0b11c4
Change all aux. buffers growing factor to 1.5.
...
This is in general better in order to avoid heap fragmentation.
When growing a buffer N times with the old factor of two (and when
realloc() cannot just grow in-place), we create a gap 2^N-1 bytes
long, but asking for 2^N bytes. This ever-growing hard-to-reuse
gap can cause troubles to some heap allocators.
See e.g. https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md
2020-01-27 11:54:10 +01:00
Martin Mitas
12175f7436
md2html.c: Improve --html output.
2020-01-10 19:39:09 +01:00
Martin Mitáš
e6661f23dc
Implement an underline extension. ( #103 )
...
Closes #101 .
2020-01-10 19:27:10 +01:00
Martin Mitas
e3b14bbe98
render_html.c: Minor clean-up.
2019-12-11 18:27:04 +01:00
Martin Mitas
6666db6daf
render_html.c: Unify HTML escaping and URL escaping.
2019-12-11 17:47:17 +01:00
niblo
43bfa54d0f
md2html.c: Fix printing input file name when output cannot be opened. ( #99 )
2019-12-10 12:11:40 +01:00
niblo
e336e6404f
Add support for Wiki links ( #92 )
...
With a new flag MD_FLAG_WIKILINKS, recoginize wiki-style links
as [[foo]] and [[foo|bar]].
Update also the HTML renderer accordingly, to output a custom
HTML tag <x-wikilink> when seeing it.
2019-11-04 15:20:59 +01:00
Martin Mitas
993c7b9b88
Render LaTeX math into HTML as a tag <x-equation>...
...
... instead of <equation>. This is to highlight that it is not a
standard HTML tag.
2019-11-03 23:32:46 +01:00
Martin Mitas
ae5ca89472
md2html/CMakeLists.txt: Use INSTALL(TARGETS) instead of INSTALL(PROGRAMS).
...
Fixes #88 .
2019-07-12 08:44:53 +02:00
Tilman Roeder
8bac86aa43
Added support for LaTeX math ( #87 )
...
Addresses #86 .
2019-07-07 10:46:10 +02:00
Craig Barnes
f0de199060
Add man page for md2html program ( #85 )
...
Fixes #56
2019-06-24 22:56:50 +02:00
Martin Mitas
c4e6ddc39a
md2html/render_html.h: Add extern "C" when included in C++.
...
Seems some people desire to use the HTML renderer in C++ projects, so
lets make this as the 1st step in making it easy :-)
2019-05-20 21:27:20 +02:00
Martin Mitas
56f8bbb19b
Implement/improve some optimizations, both in the parser and HTML renderer.
2019-05-19 21:53:58 +02:00
Martin Mitas
ef64fd3898
render_html.c: Improve RENDER_LITERAL to not cause warnings in MSVC 2017.
2019-05-13 10:46:50 +02:00
Martin Mitas
19504cad95
Revert "Build: With gcc and clang, enforce -std=c90."
...
This reverts commit 716b6ca444
.
Rationale: snprintf() not available in C90, so -std=c90 causes
warnings on Linux.
2019-04-29 22:24:23 +02:00
Martin Mitas
716b6ca444
Build: With gcc and clang, enforce -std=c90.
...
See #71 .
This forces us to be more conservative in the future code changes,
and make us more friendly mainly to some embedded compilers who are
often behind the current state of art.
Fix also related warnings and errors, as provided by gcc 8.1.0.
2019-04-17 15:04:17 +02:00
Martin Mitáš
8e01a769ea
Implement task lists. ( #50 )
...
Fixes #30 .
2019-02-10 22:58:42 +01:00
Lisandro Damián Nicanor Pérez Meyer
5f33d93308
Build md4c as a shared library. ( #49 )
...
Build md4c as a shared library.
- Define the current version in the main CMakeLists.txt, so it can be used
within the project.
- Define VERSION, SOVERSION and PUBLIC_HEADER as target properties.
- Be able to install both libmd4c and md2html.
- Create a pkg-config file.
Fixes #48
2019-02-07 19:54:25 +01:00
Martin Mitas
00236fc749
Update years in the files changed this year and in LICENSE.md.
2019-02-05 12:59:44 +01:00
Martin Mitas
03f586851f
md4c.h: Rename and refactorize MD_RENDERER struct.
...
* Rename MD_RENDERER to MD_PARSER. (Typedef to provide the original
name is provided to minimize disruption of existing code.)
* Reorder its members to make better sense.
* Add abi_version member (hopefully, it shall never be needed ;-)
* Update md2html utility to deal with the change.
Rationale:
This is done in order to prepare for long-term maintenance of ABI
compatibility, as there is no work-in-progress to be buildable as
shared lib, and be included in some Linux distros.
2019-02-05 10:29:53 +01:00
Martin Mitas
21d6cc9dce
md2html.c: Fix possible overflow in membuf_grow().
2018-04-12 12:51:07 +02:00
Martin Mitas
26c5268e0a
md2html.c: Add newline to some error messages.
2018-04-12 12:50:29 +02:00
Martin Mitas
5f47a5cbfa
md_build_attribute: Handle U+0000 character.
2017-09-11 10:58:52 +02:00
Martin Mitas
8bfb678588
render_html: Get rid of global variable.
...
This is a residue which by mistake survived the isolation of the
rendering code in the c850843c12
.
2017-08-28 16:18:56 +02:00
Martin Mitas
dc3dde78c8
render_html: Add a new line after <ol>.
...
This makes the behavior more consistent with <ul>.
2017-08-28 16:14:04 +02:00
Martin Mitas
4e831dc112
Add 2017 into copyright notes.
2017-07-15 18:42:50 +02:00
Martin Mitas
1bc7f3a84e
render_url_escaped: Fix escaping of ampersand.
...
This affected generating href attribute if links or src attribute of
images.
2017-07-14 02:24:21 +02:00
Martin Mitas
f3f9404e53
Improve URL autolinks extension.
...
It is now much more compatible to Cmark-gfm.
With the flag MD_FLAG_PERMISSIVEWWWAUTOLINKS, we now also support the
WWW autolinks (when the http: scheme is omitted).
2017-07-14 02:06:23 +02:00
Martin Mitas
82c0eb53c4
entity_lookup: Make it return UTF-32 codepoints.
...
And adapted callers accordingly.
Fixes #12 .
2017-07-13 16:23:45 +02:00
Martin Mitas
25a156ee1b
Implement strikethrough extension.
2017-07-12 23:30:14 +02:00
Martin Mitas
aa51e86f9e
md2html/md2html.c: Add options for Markdown dialect.
...
Added support for options --commonmark and --github.
2017-07-12 22:52:58 +02:00