Add and fill MD_BLOCK_CODE_DETAIL::fence_char accordingly. For the case of indented code block, it is left zeroed. Fixes #81
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b866dbb..d93424d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,9 +5,15 @@
## Next Version (Work in Progress)
Changes:
+
* Update Unicode-specific code compliant to Unicode 12.1.
+ * Structure `MD_BLOCK_CODE_DETAIL` got new member `fenced_char`. Application
+ can use it to detect character used to form the block fences (`` ` `` or
+ `~`). In the case of indented code block, it is set to zero.
+
Fixes:
+
* [#77](https://github.com/mity/md4c/issues/77):
Fix maximal count of digits for numerical character references, as requested
by CommonMark specification 0.29.
@@ -20,6 +26,7 @@ Fixes:
## Version 0.3.3
Changes:
+
* Make permissive URL autolink and permissive WWW autolink extensions stricter.
This brings the behavior closer to GFM and mitigates risk of false positives.
@@ -27,6 +34,7 @@ Changes:
can be part of the link destination only if `(` and `)` are balanced.
Fixes:
+
* [#73](https://github.com/mity/md4c/issues/73):
Some raw HTML inputs could lead to quadratic parsing times.
@@ -41,6 +49,7 @@ Fixes:
## Version 0.3.2
Changes:
+
* Changes mandated by CommonMark specification 0.29.
Most importantly, the white-space trimming rules for code spans have changed.
@@ -54,6 +63,7 @@ Changes:
for more info.
Fixes:
+
* [#68](https://github.com/mity/md4c/issues/68):
Some specific HTML blocks were not recognized when EOF follows without any
end-of-line character.
diff --git a/md4c/md4c.c b/md4c/md4c.c
index b4ab7e5..01e63a5 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -4461,6 +4461,8 @@ md_setup_fenced_code_detail(MD_CTX* ctx, const MD_BLOCK* block, MD_BLOCK_CODE_DE
lang_end++;
MD_CHECK(md_build_attribute(ctx, STR(beg), lang_end - beg, 0, &det->lang, lang_build));
+ det->fence_char = fence_ch;
+
abort:
return ret;
}
diff --git a/md4c/md4c.h b/md4c/md4c.h
index 98118e7..dcdadad 100644
--- a/md4c/md4c.h
+++ b/md4c/md4c.h
@@ -238,6 +238,7 @@ typedef struct MD_BLOCK_H_DETAIL {
typedef struct MD_BLOCK_CODE_DETAIL {
MD_ATTRIBUTE info;
MD_ATTRIBUTE lang;
+ MD_CHAR fence_char; /* The character used for fenced code block; or zero for indented code block. */
} MD_BLOCK_CODE_DETAIL;
/* Detailed info for MD_BLOCK_TH and MD_BLOCK_TD. */