i.e of the commit f436c30298.
It added bunch of checks all over the place, but most of them
shouldn't be needed: If they are true, our internal state is
already broken. In other words, those checks are hiding real bugs
and making debugging harder.
Hopefully the underlying bugs are already fixed in some of previous
commits addressing some fuzzing issues, like these:
* d775b5103e
* c6942ef03e
This allows the processor to tell whether an <A> tag is the result of
an autolink, and customize its output. For example, I want to emit an
autolink of an image URL as an <IMG> tag, and an autolink of a YouTube
URL as a video embed.
Markdown 0.30 doesn't mandate right-trimming the contents of HTML lines.
Doing so is more work and breaks output compatibility with cmark, tested
with https://github.com/commonmark/cmark/commit/9393560.
This is needed because special handling of '|' is now done also if the
wiki-links extension is enabled so the chain is populated even with that
extension.
Fixes#174.
* md_rollback: Restore dummy marks changed to virtual zero-length
closers.
* md_analyze_links: Be more careful in how we rollback contents
of a full wiki link (`[[destination|label]]`). The destination has to
be rollbacked completely (MD_ROLBACK_ALL) while the label only with
MD_ROLLBACK_CROSSING.
Fixes#173.
if we know that the bracket pair contains nested brackets. That makes
the label invalid anyway, therefore we know that there is no link ref.
def. to be found anyway.
In case of heavily nested bracket pairs, the lookup could lead to
quadratic parsing times.
Fixes#172.
The function performs a binary search over array of MD_LINE structs to
find a line the given offset lives on.
Replaced few linear scans for such lines with a call to this function.
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.
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.
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...)
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.
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.
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.
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