Skip to content

Commit 3c4600e

Browse files
committed
git diff be62b2b c3be50e > src/patches/latex-footnotes.diff
1 parent c3be50e commit 3c4600e

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

src/patches/apply.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
# Upstream PR: https://github.com/github/cmark-gfm/pull/362
44
patch -p2 -d ../cmark < 362.diff
5-
5+
# Support footnotes for LaTeX: https://github.com/r-lib/commonmark/pull/32
6+
patch -p2 -d ../cmark < latex-footnotes.diff

src/patches/latex-footnotes.diff

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git a/src/cmark/latex.c b/src/cmark/latex.c
2+
index 1a6367a..5fab7ee 100644
3+
--- a/src/cmark/latex.c
4+
+++ b/src/cmark/latex.c
5+
@@ -447,8 +447,20 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
6+
break;
7+
8+
case CMARK_NODE_FOOTNOTE_DEFINITION:
9+
+ if (entering) {
10+
+ LIT("\\footnotetext[");
11+
+ OUT(cmark_chunk_to_cstr(renderer->mem, &node->as.literal), false, LITERAL);
12+
+ LIT("]{");
13+
+ } else {
14+
+ LIT("}");
15+
+ }
16+
+ break;
17+
case CMARK_NODE_FOOTNOTE_REFERENCE:
18+
- // TODO
19+
+ if (entering) {
20+
+ LIT("\\footnotemark[");
21+
+ OUT(cmark_chunk_to_cstr(renderer->mem, &node->parent_footnote_def->as.literal), false, LITERAL);
22+
+ LIT("]");
23+
+ }
24+
break;
25+
26+
default:

0 commit comments

Comments
 (0)