Commit Graph

86 Commits

Author SHA1 Message Date
Martin Mitas
ba686ec3f1 render_html.c: Fix build with MSVC. 2016-12-16 10:16:17 +01:00
Martin Mitas
c377f567af Add some versioning info.
* md4c.h now contains macros MD_VERSION_xxxx.
 * md2html has option --version.

(Of course those shall have some meaningful values only when we introduce
some release process.)
2016-12-16 10:06:07 +01:00
Martin Mitas
c9ef8ccb2f render_html.c: Unify use of char versus MD_CHAR. 2016-12-16 09:59:03 +01:00
Martin Mitas
c850843c12 md2html: Isolate HTML renderer into render_html.c (issue #8). 2016-12-16 09:53:31 +01:00
Martin Mitas
c085ab5cfe Implement support for entities outside normal text flow (issue #5).
* Change API (md4c.h) to propagate different substring type info to renderer.
 * Implement/refactor related code in the parser.
 * Adapt renderer (md2html) to the new API.
2016-12-14 13:23:47 +01:00
Martin Mitas
09ae86095f Handle images more like links.
Remove MD_SPAN_IMG_DETAIL::alt. Instead, the contents of the image is
propagated to the renderer via MD_RENDERER::text() callback.

 * This fixes handling of entities inside the image text (issue #4).
 * It simplifies parsing and, more importantly, it better distingusshes
   what is responsibility of parser or renderer respectively.
 * This allows more flexibility on renderers side. Renderer who do not
 * really support images can just output the image content as any
   other text.

The cost is a renderer into HTML (if it wants to render image contents
into the attribute ALT of the IMG tag), has to handle images with more
care. Typically such renderer has to track whether it is inside an image,
and if so, then render span enter/leave as an empty string.
2016-12-07 23:56:47 +01:00
tin-pot
0d10f6dbe2 md2html.c: No need for <stdint.h> 2016-12-05 12:34:29 +01:00
tin-pot
bc52610ebc Fix signed/unsigned comparisons.
This removes a lot of MSVC warnings.
2016-12-05 12:21:07 +01:00
Martin Mitas
a930e46fc6 Fix build with MSVC. 2016-11-24 15:04:47 +01:00
Martin Mitas
54028ed705 Implement ordered lists. 2016-11-24 14:16:47 +01:00
Martin Mitas
b86c7f2867 Implement unordered lists. 2016-11-24 13:15:16 +01:00
Martin Mitas
be7fcc16ff Implement tables.
Note it is implemented as an extension. To enable it, the flag MD_FLAG_TABLES
must be explicitly specified.
2016-11-21 13:39:45 +01:00
Martin Mitas
9f1c4b580d Fix macro MD_FLAG_PERMISSIVEAUTOLINKS. 2016-11-21 09:48:08 +01:00
Martin Mitas
7d7d3b407c md2html: Implement URL escaping. 2016-11-21 02:41:39 +01:00
Martin Mitas
20434c8a1a Implement images. 2016-11-21 02:08:34 +01:00
Martin Mitas
36643f4a44 md2html: Fix name of link attribute 'title'. 2016-11-20 00:16:16 +01:00
Martin Mitas
1a2477952a Implement link reference definitions and, partially, link references. 2016-11-19 23:48:24 +01:00
Martin Mitas
7c9f5982c6 Fix typo in debug output. 2016-11-07 21:13:52 +01:00
Martin Mitas
ef5f230ffa Implement permissive autolinks extensions.
With MD_FLAG_PERMISSIVEURLAUTOLINKS, we treat not overly complicated URLs
as autolinks even without '<' and '>'.

With MD_FLAG_PERMISSIVEEMAILAUTOLINKS, we treat not overly complicated
e-mail addresses as autolinks even without '<', '>' and without the
'mailto:' scheme.

Also expanded md2html utility and tests to cover these.
2016-10-14 19:56:05 +02:00
Martin Mitas
296c8318f8 Implement emphasis and strong emphasis. 2016-10-13 22:20:00 +02:00
Martin Mitas
a7899c057b Implement autolinks. 2016-10-11 02:46:41 +02:00
Martin Mitas
1cfc6a5f42 Incorporate the specification testsuite from CommonMark. 2016-10-11 01:10:11 +02:00
Martin Mitas
2b740798ca Implement insecure character (NULL) replacement. 2016-10-11 00:36:39 +02:00
Martin Mitas
de2338ece8 Fix: By default, do not collapse whitespace. 2016-10-09 00:42:30 +02:00
Martin Mitas
14090e2e93 md2html: Output new-line after "</blockquote>". 2016-10-08 23:30:49 +02:00
Martin Mitas
87b41e1aba Implement entities. 2016-10-07 21:00:04 +02:00
Martin Mitas
a284a382ea Implement code spans. 2016-10-07 02:49:37 +02:00
Martin Mitas
33258e68bd Implement block quotes. 2016-10-04 21:18:30 +02:00
Martin Mitas
279ec8f6d5 Implement soft and hard line breaks. 2016-10-04 20:46:10 +02:00
Martin Mitas
e01275811f Implement raw HTML blocks. 2016-10-04 20:29:22 +02:00
Martin Mitas
d2da226c44 Implement fenced code blocks. 2016-10-04 19:48:06 +02:00
Martin Mitas
43bd28445b Implemented indented code blocks. 2016-10-04 03:26:56 +02:00
Martin Mitas
80984c98c8 Little code clean-up. 2016-10-04 02:19:10 +02:00
Martin Mitas
0225f337b4 Implement ATX headers. 2016-10-04 00:55:32 +02:00
Martin Mitas
63a92c0862 Implement thematic breaks (<hr>). 2016-10-04 00:18:08 +02:00
Martin Mitas
efed58af8e Initial commit. 2016-10-03 20:22:25 +02:00