mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
787 stars 146 forks source link

Implement an underline extension. #103

Closed mity closed 4 years ago

mity commented 4 years ago

(to address #101)

The rules to decide when we see _ as a special char or an ordinary char are the same as in CommonMark. But with MD_FLAG_UNDERLINE, every single _ seen as a valid is then translated into <u> (or </u>).

This effectively means that __foo__ without the flag is rendered into <strong>foo</strong>, but with the flag enabled it becomes <u><u>foo</u></u>.

@pbek @Waqar144 Are you fine with it this way?

For testing, md2html now understands the command line option --funderline.

codecov[bot] commented 4 years ago

Codecov Report

Merging #103 into master will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage    94.3%   94.32%   +0.01%     
==========================================
  Files           1        1              
  Lines        2704     2713       +9     
==========================================
+ Hits         2550     2559       +9     
  Misses        154      154
Impacted Files Coverage Δ
md4c/md4c.c 94.32% <100%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update cafe872...9c19ebb. Read the comment docs.

Waqar144 commented 4 years ago

WOW! :rocket: :rocket:

Thank you so much.

Its looking like this: image

Really great. Handles all the inputs as expected!