Commit Graph

683 Commits

Author SHA1 Message Date
Martin Mitas
403043bba3 md_mark_chain_append: Set next of the tail mark to -1.
Fixes #104.
2020-01-16 16:27:37 +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
cafe872c3d md_analyze_link_contents: Simplify. 2020-01-10 16:13:32 +01:00
Martin Mitas
82d7d087cc Rework/improve recognition of strike-through spans.
Closes #102.
2020-01-10 16:11:21 +01:00
Martin Mitas
78850528d9 Update copyright note year. 2020-01-07 00:33:05 +01:00
Martin Mitas
561f52e05f md_is_autolink_email: Fix an off-by-one error.
Fixes #100.
2020-01-05 18:33:46 +01:00
Martin Mitas
1a984d23d0 Minor code formatting clean-up. 2020-01-05 18:07:37 +01:00
Martin Mitas
fa75676efa md_build_ref_def_hashtable: Minor cleanup.
* Add some comments.

 * Make complex hastable buckets start at 2 records instead of 4.
   Some experiments show there may be about 20% collisions in documents
   with too many reference links but the buckets rarely need more then
   the 2 records so it is just a memory wasting.
2020-01-02 15:09:57 +01:00
Martin Mitas
9b0014e42d CHANGELOG.md: Minor wording improvement. 2020-01-02 14:30:53 +01:00
Martin Mitas
c9a3e1e992 Make md_strchr() macro calling strchr() (or wcschr())...
... instead of providing our own implementation.
2020-01-02 14:24:49 +01:00
Martin Mitas
e1216dae9b Simplify/unify some temp. string buffer memory management. 2020-01-02 14:24:31 +01:00
Martin Mitas
b3739a42ad md_is_html_block_start_condition: Fix the MD4C_USE_UTF16 mode.
The function was calling md_ascii_case_eq() incorrectly with a number of
bytes instead of characters. This could lead to invalid memory accesses
and/or mis-detection of raw HTML blocks in the special MD4C_USE_UTF16
builds on Windows.
2019-12-28 20:34:51 +01:00
Martin Mitas
64210986fe README.md: Add section about SW using MD4C. 2019-12-16 00:25:13 +01:00
Martin Mitas
b06f912adf README.md: Add missing info about wikilinks extension. 2019-12-14 14:06:46 +01:00
Martin Mitas
2eeff38766 README.md: Yet another minor update. 2019-12-13 20:45:20 +01:00
Martin Mitas
92175c48b3 README.md: Few more wording improvements. 2019-12-13 18:25:45 +01:00
Martin Mitas
b9fc02211a README.md: Minor wording changes and typo fixes. 2019-12-13 13:50:06 +01:00
Martin Mitas
3f5ef0b69b CHANGELOG.md: Fix a typo. 2019-12-13 13:41:53 +01:00
Martin Mitas
64bf660aab Make the UTF-8 mode the default one.
It was already the default when building with our CMakeLists.txt but it
seems that for projectswich are just embedding our sources into their
build so this change only affects projects embedding direcly our source
files into their project.
2019-12-13 13:24:08 +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
Martin Mitas
753d916f88 README.md: Few more minor wording improvements. 2019-12-11 14:55:46 +01:00
Martin Mitas
6835cdd5d7 README.md: A grammer fix. 2019-12-11 14:30:59 +01:00
Martin Mitas
e0bbf449eb README.md: Update the README.
* Improve some wording.
 * Add Documentation secion.
 * Add FAQ section.
 * Add link to markdown-wasm.
2019-12-11 14:27:24 +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
Martin Mitas
db8e9fac38 README.md: Add logos to the badges. 2019-12-06 04:13:23 +01:00
Martin Mitas
4e2b37e47f Bump version to 0.4.2. 2019-11-29 12:58:41 +01:00
Martin Mitas
46f25f0b47 md_analyze_emph: Call md_resolve_range() with proper chain.
Errorneously, we have called md_resolve_range() with mark chain derived
from the closer mark. In the case that the opener and closer marks
differ in length (and we have split one or the other), we pass in an
incorrect chain, which may lead to strange behavior in subsequent
analysis.

Fixes #98.
2019-11-12 21:48:26 +01:00
Martin Mitas
787642173e Bump version to 0.4.1 and fix CHANGELOG.md. 2019-11-04 15:38:21 +01:00
Martin Mitas
a6b37216a1 Bump version to 0.4.0. 2019-11-04 15:30:17 +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 Mitáš
ef85cfc278
Simplify parsing of tables (#97)
We do so by removing the function md_is_table_row().

md_is_table_row() did some crazy inline parsing to detect whether the
line contains at least one pipe which is not inside a code span or other
high-priority inline element.

This was very complicated under the hood and to was actually breaking
the clean design which separates block analysis parse and inline analysis
of each block contents.

We now just use the table underline for determining the block is table
and its properties like e.g. the column count.

This means a paragraph now cannot interrupt a table. This is a change in
a behavior but likely acceptable one as it actually brings the behavior
closer to behavior of tables in cmark-gfm in this regard.

Last but not least, it seems to prevent adoption of other useful
features, for about that, see the discussion in PR #92.
2019-11-04 15:05:07 +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
13a5a4b4ee README.md: Update link to commonmark-d. 2019-11-03 22:21:18 +01:00
Martin Mitas
e97d0250bb Link label comparision fixes.
* md_link_label_cmp: To match the labels, the loop has to reach ends of
   the labels for both of them.

 * md_link_label_cmp_load_fold_info: Collapse consequtive whitespace
   into a single ' ' for the label comparison purposes.

Fixes #96.
2019-11-03 13:57:00 +01:00
Martin Mitas
0354e1ab5a md_is_container_mark: Ordered list mark requires at least one digit.
Fixes #95.
2019-10-04 22:35:54 +02:00
Martin Mitas
64a63d537f README.md: Add link to commonmark-d as a port of MD4C for D language. 2019-10-03 20:21:00 +02:00
Martin Mitas
728f2af406 md_build_ref_def_hashtable: Do not allocate more memory then needed.
Fixes #94.
2019-10-03 20:16:10 +02:00
Martin Mitas
ae5ca89472 md2html/CMakeLists.txt: Use INSTALL(TARGETS) instead of INSTALL(PROGRAMS).
Fixes #88.
2019-07-12 08:44:53 +02:00
Martin Mitas
9760636977 Fix the last test case in latex-math.txt. 2019-07-07 11:19:21 +02:00
Martin Mitas
9e8b3548b5 Simplify some assertions. 2019-07-07 11:16:23 +02:00
Martin Mitas
099ce69b04 Add missing file into git. 2019-07-07 11:15:44 +02:00
Martin Mitas
2e965941ed Add/improve docs for the LaTeX math spans. 2019-07-07 10:59:20 +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
410bb41977 Bump version to 0.3.4. 2019-06-19 17:04:48 +02:00
Martin Mitas
b2e60066fd README.md: Shorten an URL to improve line wrapping. 2019-05-30 15:59:22 +02:00
Martin Mitas
ce8b5d9440 md_analyze_line: Blockquote with blank line can interrupt a paragraph.
Fixes #83.
2019-05-27 22:16:35 +02:00
Martin Mitas
7d1cfbc124 CHANGELOG.md: Fix some wording. 2019-05-23 22:50:37 +02:00