break;
case BLOCK_SETEXT_2:
level = 2;
+ break;
default:
level = 1 + current->type - BLOCK_H1;
}
break;
case BLOCK_SETEXT_2:
t_level = 2;
+ break;
default:
t_level = 1 + t->type - BLOCK_H1;
}
return;
short temp_short;
- short temp_short2;
- link * temp_link = NULL;
char * temp_char = NULL;
- char * temp_char2 = NULL;
- char * temp_char3 = NULL;
- bool temp_bool = 0;
token * temp_token = NULL;
- footnote * temp_note = NULL;
switch (t->type) {
case DOC_START_TOKEN:
pad(out, 2, scratch);
note = stack_peek_index(scratch->used_citations, i);
- content = note->content;
printf("\\bibitem{%s}\n", note->label_text);
scratch->padded = 6;
void mmd_export_link_latex(DString * out, const char * source, token * text, link * link, scratch_pad * scratch) {
- attr * a = link->attributes;
char * temp_char;
if (link->url) {
} else
print("\\href{}");
-// if (link->title && link->title[0] != '\0') {
-// print(" title=\"");
-// mmd_print_string_latex(out, link->title);
-// print("\"");
-// }
-
-// while (a) {
-// print(" ");
-// print(a->key);
-// print("=\"");
-// print(a->value);
-// print("\"");
-// a = a->next;
-// }
-
print("{");
// If we're printing contents of bracket as text, then ensure we include it all
if (t->next && t->next->type == TABLE_DIVIDER) {
t = t->next;
- if (t->next && t->next->type == TABLE_CELL)
+ if (t->next && t->next->type == TABLE_CELL) {
print("&");
-
- scratch->table_cell_count += t->next->len;
+ scratch->table_cell_count += t->next->len;
+ }
} else
scratch->table_cell_count++;
scratch->footnote_para_counter = 0;
- content = note->content;
scratch->citation_being_printed = i + 1;
mmd_export_token_tree_latex(out, source, content, scratch);
if (t == NULL)
return;
- short temp_short;
- short temp_short2;
- link * temp_link = NULL;
char * temp_char = NULL;
- char * temp_char2 = NULL;
- char * temp_char3 = NULL;
- bool temp_bool = 0;
- token * temp_token = NULL;
- footnote * temp_note = NULL;
switch (t->type) {
case DOC_START_TOKEN:
goto handle_line;
}
default:
- handle_block:
//fprintf(stderr, "Unspecified line type %d inside block type %d\n", l->type, block->type);
// This is a block, need to remove it from chain and
// Add to parent
-/* Generated by re2c 0.14.3 on Mon Feb 13 09:48:30 2017 */
+/* Generated by re2c 0.14.3 on Thu Feb 16 19:37:08 2017 */
/**
MultiMarkdown 6 -- Lightweight markup processor to produce HTML, LaTeX, and more.
size_t scan_meta_key(const char * c) {
- const char * marker = NULL;
const char * start = c;
size_t scan_destination(const char * c) {
- const char * marker = NULL;
const char * start = c;
size_t scan_meta_key(const char * c) {
- const char * marker = NULL;
const char * start = c;
/*!re2c
size_t scan_destination(const char * c) {
- const char * marker = NULL;
const char * start = c;
/*!re2c
char * result = NULL;
if (source && pair) {
- if (pair->child->mate) {
+ if (pair->child && pair->child->mate) {
// [foo], [^foo], [#foo] should give different strings -- use closer len
result = strndup(&source[pair->start + pair->child->mate->len], pair->len - (pair->child->mate->len * 2));
} else {
- result = strndup(&source[pair->start + pair->child->len], pair->len - (pair->child->len + 1));
+ if (pair->child)
+ result = strndup(&source[pair->start + pair->child->len], pair->len - (pair->child->len + 1));
}
}
if (temp_link) {
// Don't output brackets
- bracket->child->type = TEXT_EMPTY;
- bracket->child->mate->type = TEXT_EMPTY;
-
+ if (bracket->child) {
+ bracket->child->type = TEXT_EMPTY;
+
+ if (bracket->child->mate)
+ bracket->child->mate->type = TEXT_EMPTY;
+ }
+
*final_link = temp_link;
// Skip over second bracket if present
(t->next->type == TEXT_LINEBREAK)))
t = t->next;
- if (t->next == NULL)
+ if (t && t->next == NULL)
return true;
}
}