md

cat markdown files with syntax highlighting
git clone https://noulin.net/git/md.git
Log | Files | Refs | README | LICENSE

commit 067cac4629b2ee3b275c18e6d23be0e2bbf7c288
parent 78d585ded125e3841b6643546ebf4b6d41328972
Author: Remy Noulin <loader2x@gmail.com>
Date:   Fri, 20 Jan 2023 13:12:59 +0100

update md4c to fix issue wth conceal/hidden mark

shpPackages/md4c/md4c.c      | 10 +++++++---
shpPackages/md4c/package.yml |  2 +-
2 files changed, 8 insertions(+), 4 deletions(-)

Diffstat:
Mpackage.yml | 2+-
MshpPackages/md4c/md4c.c | 10+++++++---
MshpPackages/md4c/package.yml | 2+-
3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/package.yml b/package.yml @@ -1,6 +1,6 @@ --- name: md - version: 0.0.7 + version: 0.0.8 description: cat markdown files with syntax highlighting bin: ./md.c repository: diff --git a/shpPackages/md4c/md4c.c b/shpPackages/md4c/md4c.c @@ -4540,12 +4540,16 @@ md_process_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines) case '!': /* conceal/hidden */ if (mark->prev == -1) { - if(mark->flags & MD_MARK_OPENER) { + if (mark->flags & MD_MARK_OPENER) { MD_ENTER_SPAN(MD_SPAN_COC, NULL); - } else { + break; + } + } + else { + if (ctx->marks[mark->prev].ch == '!' && !(mark->flags & MD_MARK_OPENER)) { MD_LEAVE_SPAN(MD_SPAN_COC, NULL); + break; } - break; } case '[': /* Link, wiki link, image, anchor. */ case ']': diff --git a/shpPackages/md4c/package.yml b/shpPackages/md4c/package.yml @@ -1,6 +1,6 @@ --- name: md4c - version: 0.0.1 + version: 0.0.3 description: "md4c is a markdown parser library (forked from mity/md4c)" bin: ./md4c.c scripts: