summaryrefslogtreecommitdiff
path: root/src/inlines.c
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-15 22:02:02 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-15 22:02:02 -0800
commit10e90b78c99ccc13233ef8bba98b7fbf3fe14750 (patch)
tree23fe547c40f1b12febe5915a54666e9d1f9d4af9 /src/inlines.c
parent4a3320a75c7eaf2f3f5451ab0bc0ef4e3f2e1554 (diff)
Don't expose append_inlines.
Diffstat (limited to 'src/inlines.c')
-rw-r--r--src/inlines.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/inlines.c b/src/inlines.c
index 0dabbd3..cf07586 100644
--- a/src/inlines.c
+++ b/src/inlines.c
@@ -101,6 +101,21 @@ static inline chunk take_while(subject* subj, int (*f)(int))
return chunk_dup(&subj->input, startpos, len);
}
+// Append inline list b to the end of inline list a.
+// Return pointer to head of new list.
+static inline cmark_node_inl* cmark_append_inlines(cmark_node_inl* a, cmark_node_inl* b)
+{
+ if (a == NULL) { // NULL acts like an empty list
+ return b;
+ }
+ cmark_node_inl* cur = a;
+ while (cur->next != NULL) {
+ cur = cur->next;
+ }
+ cur->next = b;
+ return a;
+}
+
// Try to process a backtick code span that began with a
// span of ticks of length openticklength length (already
// parsed). Return 0 if you don't find matching closing