Commit Graph

683 Commits

Author SHA1 Message Date
Martin Mitas
ea188729d8 Emit '\n' after the XHTML root tag.
Fixes #163.
2021-07-15 18:58:39 +02:00
Martin Mitas
ccc8b64a96 md_html: Add ~ to the list of characters not escaped in URIs.
Fixes #165.
2021-07-15 18:56:46 +02:00
Martin Mitas
d5f8cc29b5 Update README.md and CHANGELOG.md. 2021-06-27 18:49:33 +02:00
Martin Mitas
82b226ffb5 md_is_html_block_start_condition: Accept lower-case HTML declaration.
The change is mandated by the spec v. 0.30.
2021-06-27 18:49:33 +02:00
Martin Mitas
d50a0142a0 md_is_html_block_start_condition: Update for 0.30.
The spec. 0.30 adds the tag <textarea> into the list if HTML blocks
start condition type 1.
2021-06-27 18:49:33 +02:00
Martin Mitas
c01aa6b394 Update CommonMark spec file to v. 0.30 2021-06-27 18:49:33 +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
c3340b480e Bump version to 0.4.8. 2021-05-11 12:33:32 +02:00
Martin Mitas
da77b928d7 CHANGELOG.md: Fix typo. 2021-04-15 19:14:43 +02:00
Martin Mitas
0cebd6ff11 CHANGELOG.md: Update. 2021-04-14 18:31:18 +02:00
Martin Mitas
b2ee4b194c md_resolve_links: Fix the test for the nested autolink covering whole link text.
This fixes the fix for #152.
2021-04-14 18:27:19 +02:00
Martin Mitas
bcb55d0d40 md_resolve_links: Suppress bogus nested permissive autolink.
Fixes #152.
2021-04-14 09:18:09 +02:00
Martin Mitas
4fc808d8fe md_analyze_line: Avoid reading 1 byte beyond the input size.
Fixes #155.
2021-03-29 12:51:48 +02:00
Martin Mitas
aa65423091 md_enter_child_containers: Propagate list mark character properly.
Fixes #153, #154.
2021-03-22 14:04:55 +01:00
DavidKorczynski
3478ec69c1
Added fuzzer for oss-fuzz integration. (#151) 2021-02-23 15:01:31 +01:00
Martin Mitas
269bbdb31b Fix output with --full-html command line options.
Fixes #150.
2021-02-11 21:46:33 +01:00
Martin Mitas
fe2f242774 Fix copy&paster error in a comment. 2021-02-11 11:35:54 +01:00
Martin Mitas
fd7b5fe085 md_analyze_line: Fix implicit ending of HTML blocks...
... when the HTML block is not explicitly ended (before the enclosing
container block ends).

Fixes #149.
2021-02-05 21:50:57 +01:00
Niclas Rosenvik
2b6ebdfa39
Fix use of the cmake package (#146)
Fix use of the cmake package

Fix use of the cmake package and its imported targets.
Make sure that the include dir comes with the cmake targets
Put everything under md4cConfig so that the md4c-html can see
md4c.
Use md4c namespace so that the targets become md4c::md4c and
md4c::md4c-html following cmake standards for imported targets.

Fixes #145.
2021-01-09 11:54:27 +01:00
Martin Mitas
aa63198b80 Bump version to 0.4.7. 2020-12-24 15:04:35 +01:00
Martin Mitas
9ba57ccb2e md_link_label_cmp_load_fold_info: Remove a bogus code.
The input into the function is already guaranted to not have a new line
characters. (And handling of them in the function was broken anyway.)
2020-12-14 19:53:58 +01:00
Martin Mitas
da5821ae0d Fix testcase for issue #142. 2020-12-14 19:53:40 +01:00
Martin Mitas
5a44e327a0 md_link_label_cmp: Fix the loop end condition.
The old version likely could stop prematurely in a corner case when
there was a Unicode character at the end of the either string, which
maps into multiple fold info codepoints.

Fixes #142.
2020-12-14 19:30:23 +01:00
Martin Mitas
d4a78622a1 Minor cleanup. 2020-12-14 18:58:00 +01:00
Martin Mitas
701a06266b Make MD_UNICODE_FOLD_INFO::n_codepoints unsigned. 2020-12-14 18:57:55 +01:00
Giuseppe D'Angelo
a45f839b7b Fix mixed signed/unsigned comparisons
Force both operands to unsigned. n_codepoints does not seem to ever
contain negative offsets anyhow, should it actually be unsigned?
2020-12-14 18:41:30 +01:00
Giuseppe D'Angelo
6dd6434653 Silence "unused parameter" warnings
Merely added a suitable macro. Didn't refactor any code to
actually figure out why the parameters were not used.
2020-12-14 18:41:30 +01:00
Giuseppe D'Angelo
569defae40 Silence -Wimplicit-fallthrough warnings
Use a macro that dispatches to the compiler-specific magic
to silence implicit fallthrough warnings when the fallthrough
was actually intended. The code already featured comments,
so these are actually safe to place.

(Unfortunately, Clang does not recognize any comment as
"fall through" comment, and GCC only recognizes some variations
of "fall through", not "pass through". Moreover, one of the
comments replaced here had a typo...)
2020-12-14 18:41:30 +01:00
Giuseppe D'Angelo
e1b4187611 Enable more warnings when building under GCC/Clang 2020-12-14 18:41:30 +01:00
Martin Mitas
26003b8881 md_is_container_mark: Recognize list item marks just before EOF.
We were recognizing the list item marks when a new line or a blank
character follows.

However, given end-of-file means implicitly also an end-of-line, we
should recognize in that situation too.

Fixes #139.
2020-12-04 22:34:06 +01:00
Martin Mitas
3254b7cb00 md_process_table_block_contents: Suppress empty TBODY block generation.
When the table has no body rows, do not call the callback with
MD_BLOCK_TBODY events.

Fixes #138.
2020-11-13 12:02:39 +01:00
Martin Mitas
a997cb21bf Add MD_BLOCK_TABLE_DETAIL.
This allows renderers to have the info about table dimension (table
column and row count) in advance and e.g. simplify their memory
allocation strategy.
2020-11-13 11:59:49 +01:00
Martin Mitas
4585088ad7 md_analyze_permissive_url_autolink: Better GFM compatibility.
The autolinks now allow unmatched parenthesis, only the trailing
parenthesis closers are handled specially to deal with the situation the
autolink is all inside an outer parenthesis.

Somehow our tests were broken and avoided the cases with unmatched
parenthesis pairs inside the auto-link. That's now fixed and in sync
with GFM specs too.

Fixes #135.
2020-11-13 10:22:34 +01:00
Martin Mitas
c3a18d5587 md_collect_marks: continue -> break
Does not cause any change in behavior: we just avoid needless loop
iterations now.
2020-11-13 09:28:56 +01:00
Martin Mitas
baa1dd06eb Fix some English wording in comments. 2020-11-09 16:03:00 +01:00
srinivas32
23621a6193 added power support arch ppc64le on YML file.
Added power support for the travis.yml file with ppc64le. This is part of the Ubuntu distribution for ppc64le.
2020-11-05 14:37:57 +01:00
Rasmus Andersson
125e8e03e6 Initializes an uninitilized variable in md_analyze_emph
Fixes the following, reported by clang analysis:

src/md4c.c:3729:61: warning: variable 'opener_index' may be uninitialized when used here [-Wconditional-uninitialized]
            MD_MARKCHAIN* opener_chain = md_mark_chain(ctx, opener_index);
                                                            ^~~~~~~~~~~~
src/md4c.c:3686:25: note: initialize the variable 'opener_index' to silence this warning
        int opener_index;
                        ^
                         = 0
2020-10-24 19:26:57 +02:00
Rasmus Andersson
1a2f4816a7 Adds missing field initializers (undefined behavior)
src/md4c.c:5667:72: warning: missing field 'beg' initializer [-Wmissing-field-initializers]
static const MD_LINE_ANALYSIS md_dummy_blank_line = { MD_LINE_BLANK, 0 };
2020-10-24 19:02:48 +02:00
Rasmus Andersson
1b2840cbd6 adds /build dir to gitignore
Documentation https://github.com/mity/md4c/wiki/Building-MD4C says to use
build/ for cmake. I noticed that .gitignore contains a directory called
build-aux -- perhaps the author were using that and either forgot to update
the gitignore file or the documentation.
2020-10-24 18:51:29 +02:00
Martin Mitas
002f76c975 md_resolve_links: Skip [...] used as a reference link/image label.
Fixes #131.
2020-10-18 09:43:06 +02:00
Martin Mitas
601885f738 Bump version to 0.4.6. 2020-09-30 11:44:48 +02:00
Martin Mitas
22ca89a300 Fix ISANYOF encountering a zero byte in the input.
When it happened, it could lead to unexpected results, including broken
internal state of the parser.

Fixes #130.
2020-09-29 21:33:43 +02:00
Martin Mitas
bcdbd126a5 scripts/build_folding_map.py: Fix/improve a comment. 2020-09-17 09:55:33 +02:00
Karsten
440ccd82f3 Update md4c.h 2020-08-19 10:13:23 +02:00
Martin Mitas
9651f78051 Improve docs comments. 2020-08-16 11:28:21 +02:00
Martin Mitas
db7d1c92ec Bump version to 0.4.5. 2020-08-16 10:56:19 +02:00
Martin Mitas
67214417dd Make mark_chain[] helper macro definitions safer. 2020-08-05 10:53:52 +02:00
Martin Mitas
70d0ef7c91 Avoid simple {0} to initialize a more complex object.
Should fix #125.
2020-08-05 09:18:41 +02:00
Martin Mitas
3980028ad8 README.md: Some minor improvements. 2020-08-03 16:57:45 +02:00
Martin Mitas
c501c891b9 Fix spelling of "than" in many occurances.
I often spell it errorneously as "then". Doing this mistake way too
often when typing fast.
2020-07-30 10:13:05 +02:00