Skip to content

Commit 73bb24f

Browse files
committed
Expose cmark_node_parent_footnote_def.
1 parent 766f161 commit 73bb24f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/cmark-gfm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ CMARK_GFM_EXPORT cmark_node *cmark_node_first_child(cmark_node *node);
225225
*/
226226
CMARK_GFM_EXPORT cmark_node *cmark_node_last_child(cmark_node *node);
227227

228+
/** Returns the footnote reference of 'node', or NULL if 'node' doesn't have a
229+
* footnote reference.
230+
*/
231+
CMARK_GFM_EXPORT cmark_node *cmark_node_parent_footnote_def(cmark_node *node);
232+
228233
/**
229234
* ## Iterator
230235
*

src/node.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,14 @@ cmark_node *cmark_node_last_child(cmark_node *node) {
301301
}
302302
}
303303

304+
cmark_node *cmark_node_parent_footnote_def(cmark_node *node) {
305+
if (node == NULL) {
306+
return NULL;
307+
} else {
308+
return node->parent_footnote_def;
309+
}
310+
}
311+
304312
void *cmark_node_get_user_data(cmark_node *node) {
305313
if (node == NULL) {
306314
return NULL;

0 commit comments

Comments
 (0)