Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch markdown-footnotes Excluding Merge-Ins
This is equivalent to a diff from 8d4c4792 to 0850862e
2022-04-23
| ||
21:32 | Extend Markdown with footnotes support. See known limitations and the corresponding forum thread. ... (check-in: 3990518b user: george tags: trunk) | |
17:23 |
Change signature of add_inline_footnote() in order to move away from returning of unreliable pointer. Amend a few comments. Fix a couple of minor issues that fuzzer complains about.
...
(Closed-Leaf
check-in: 0850862e user: george tags: markdown-footnotes)
| |
15:56 |
Fix a possible heap-buffer-overflow in parse_htmlblock() introduced by [1e919d601f774fdb]. This is not related to footnotes but was revealed by fuzzing (case 80cbb6b185807e98a953426af7b1f802c9d13957).
...
(check-in: bc4c5b63 user: george tags: markdown-footnotes)
| |
2022-04-20
| ||
13:55 | Added a section to build.wiki about building for fuzz testing. ... (check-in: a42f5af8 user: stephan tags: trunk) | |
11:48 | Merged in trunk for fuzz.c changes. ... (check-in: c9f40135 user: stephan tags: markdown-footnotes) | |
11:46 | Correct fuzz.c to honor --fuzztype markdown and add --fuzztype wiki2 which works like its previous --fuzztype wiki behavior, sending all inputs through both the fossil-wiki and markdown translators. Added a fatal error for --fuzztype artifact, as that tester is not implemented. ... (check-in: 8d4c4792 user: stephan tags: trunk) | |
09:38 | Changed zlib crc type from int to unsigned long, as that's the type returned by zlib's crc32() and doing so reportedly resolves the CRC error reported in forum post 7a9097e557. ... (check-in: 1bf6686e user: stephan tags: trunk) | |
Changes to Makefile.in.
︙ | |||
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 | 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 78 79 80 81 82 83 | + + + + + + + + + + | TCLSH = @TCLSH@ CFLAGS = @CFLAGS@ CFLAGS_INCLUDE = @CFLAGS_INCLUDE@ LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ BCCFLAGS = @CPPFLAGS@ $(CFLAGS) TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H # # Fuzzing may be enable by appending -fsanitize=fuzzer -DFOSSIL_FUZZ # to the TCCFLAGS variable. # For more thorouth (but also slower) investigation # -fsanitize=fuzzer,undefined,address # might be more useful. INSTALLDIR = $(DESTDIR)@prefix@/bin USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ SQLITE3_SRC.2 = @SQLITE3_SRC.2@ SQLITE3_OBJ.2 = @SQLITE3_OBJ.2@ SQLITE3_SHELL_SRC.2 = @SQLITE3_SHELL_SRC.2@ SQLITE3_ORIGIN = @SQLITE3_ORIGIN@ # SQLITE3_ORIGIN changes... # SQLITE3_SRC: # 0=src/sqlite3.c, 1=src/sqlite3-see.c, 2=$(SQLITE3_SRC.2) # SQLITE3_SHELL_SRC: # 0=src/shell.c, 1=src/shell-see.c, 2=$(SQLITE3_SHELL_SRC.2) USE_LINENOISE = @USE_LINENOISE@ USE_MMAN_H = @USE_MMAN_H@ USE_SEE = @USE_SEE@ APPNAME = fossil # # APPNAME = fossil-fuzz # may be more appropriate for fuzzing. .PHONY: all tags include $(SRCDIR)/main.mk distclean: clean -rm -f autoconfig.h config.log Makefile |
︙ |
Changes to src/backlink.c.
︙ | |||
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | + + + + + + | void markdown_extract_links( char *zInputText, Backlink *p ){ struct mkd_renderer html_renderer = { /* prolog */ (void(*)(Blob*,void*))mkdn_noop0, /* epilog */ (void(*)(Blob*,void*))mkdn_noop0, /* footnotes */ (void(*)(Blob*,const Blob*, void*))mkdn_noop0, /* blockcode */ (void(*)(Blob*,Blob*,void*))mkdn_noop0, /* blockquote */ (void(*)(Blob*,Blob*,void*))mkdn_noop0, /* blockhtml */ (void(*)(Blob*,Blob*,void*))mkdn_noop0, /* header */ (void(*)(Blob*,Blob*,int,void*))mkdn_noop0, /* hrule */ (void(*)(Blob*,void*))mkdn_noop0, /* list */ (void(*)(Blob*,Blob*,int,void*))mkdn_noop0, /* listitem */ (void(*)(Blob*,Blob*,int,void*))mkdn_noop0, /* paragraph */ (void(*)(Blob*,Blob*,void*))mkdn_noop0, /* table */ (void(*)(Blob*,Blob*,Blob*,void*))mkdn_noop0, /* table_cell */ (void(*)(Blob*,Blob*,int,void*))mkdn_noop0, /* table_row */ (void(*)(Blob*,Blob*,int,void*))mkdn_noop0, /* footnoteitm*/ (void(*)(Blob*,const Blob*,int,int,void*))mkdn_noop0, /* autolink */ (int(*)(Blob*,Blob*,enum mkd_autolink,void*))mkdn_noop1, /* codespan */ (int(*)(Blob*,Blob*,int,void*))mkdn_noop1, /* dbl_emphas */ (int(*)(Blob*,Blob*,char,void*))mkdn_noop1, /* emphasis */ (int(*)(Blob*,Blob*,char,void*))mkdn_noop1, /* image */ (int(*)(Blob*,Blob*,Blob*,Blob*,void*))mkdn_noop1, /* linebreak */ (int(*)(Blob*,void*))mkdn_noop1, /* link */ backlink_md_link, /* r_html_tag */ (int(*)(Blob*,Blob*,void*))mkdn_noop1, /* tri_emphas */ (int(*)(Blob*,Blob*,char,void*))mkdn_noop1, /* footnoteref*/ (int(*)(Blob*,const Blob*,const Blob*,int,int,void*))mkdn_noop1, 0, /* entity */ 0, /* normal_text */ "*_", /* emphasis characters */ 0 /* client data */ }; Blob out, in; html_renderer.opaque = (void*)p; |
︙ |
Changes to src/blob.c.
︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | 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 78 79 80 81 82 83 84 85 86 87 | + + + + + + + + + + + + + + + + + + + + + + + | #define blob_size(X) ((X)->nUsed) /* ** The buffer holding the blob data */ #define blob_buffer(X) ((X)->aData) /* ** Append blob contents to another */ #define blob_appendb(dest, src) \ blob_append((dest), blob_buffer(src), blob_size(src)) /* ** Append a string literal to a blob ** TODO: Consider renaming to blob_appendl() */ #define blob_append_literal(blob, literal) \ blob_append((blob), "" literal, (sizeof literal)-1) /* * The empty string in the second argument leads to a syntax error * when the macro is not used with a string literal. Unfortunately * the error is not overly explicit. */ /* ** TODO: Suggested for removal because the name seems misleading. */ #define blob_append_string blob_append_literal /* ** Seek whence parameter values */ #define BLOB_SEEK_SET 1 #define BLOB_SEEK_CUR 2 #endif /* INTERFACE */ |
︙ | |||
323 324 325 326 327 328 329 | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | - - - - - - - | } nUsed = pBlob->nUsed; pBlob->nUsed += nData; pBlob->aData[pBlob->nUsed] = 0; memcpy(&pBlob->aData[nUsed], aData, nData); } |
︙ | |||
501 502 503 504 505 506 507 | 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | - + | return p->aData; } /* ** Compare two blobs. Return negative, zero, or positive if the first ** blob is less then, equal to, or greater than the second. */ |
︙ |
Changes to src/default.css.
︙ | |||
1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 | 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | body.branch .submenu > a.timeline-link.selected { display: inline; } .monospace { font-family: monospace; } div.markdown > ol.footnotes { font-size: 90%; } div.markdown > ol.footnotes > li { margin-bottom: 0.5em; } div.markdown ol.footnotes > li.fn-joined > sup.fn-joined { color: gray; font-family: monospace; } div.markdown ol.footnotes > li.fn-joined > sup.fn-joined::after { content: "(joined from multiple locations) "; } div.markdown ol.footnotes > li.fn-misreference { margin-top: 0.75em; margin-bottom: 0.75em; } div.markdown ol.footnotes > li.fn-toodeep > i, div.markdown ol.footnotes > li.fn-misreference, div.markdown ol.footnotes > li.fn-unreferenced { color: gray; } div.markdown ol.footnotes > li.fn-misreference > span { color: red; } div.markdown ol.footnotes > li.fn-misreference > span::after { content: " (use of undefined label)."; } div.markdown ol.footnotes > li.fn-unreferenced { padding-left: 0.5em; } div.markdown ol.footnotes > li.fn-unreferenced > code { color: red; } div.markdown ol.footnotes > li.fn-unreferenced > i::after { content: " was defined but is not referenced"; } div.markdown ol.footnotes > li.fn-toodeep > i::after { content: " depth of nesting of inline footnotes exceeded the limit"; } div.markdown ol.footnotes > li.fn-toodeep > pre, div.markdown ol.footnotes > li.fn-unreferenced > pre { color: gray; font-size: 85%; padding-left: 0.5em; margin-top: 0.25em; border-left: 2px solid red; } div.markdown ol.footnotes > li.fn-toodeep > pre { margin-left: 0.5em; } div.markdown > ol.footnotes > li > .fn-backrefs { margin-right: 0.5em; font-weight: bold; } div.markdown > ol.footnotes > li > .fn-backrefs > a, div.markdown sup.noteref > a { padding-left: 2px; padding-right: 2px; } div.markdown sup.noteref.misref, div.markdown sup.noteref.misref > a { color: red; font-size: 90%; } div.markdown sup.noteref > a:target, div.markdown span.notescope:target > sup.noteref > a, div.markdown span.notescope:hover > sup.noteref > a, div.markdown > ol.footnotes > li > .fn-backrefs > a:target { background: gold; } div.markdown span.notescope:hover, div.markdown span.notescope:target { border-bottom: 2px solid gold; } /* Objects in the "desktoponly" class are invisible on mobile */ @media screen and (max-width: 600px) { .desktoponly { display: none; } } |
︙ |
Changes to src/encode.c.
︙ | |||
203 204 205 206 207 208 209 210 211 212 213 214 215 216 | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | ** characters are encoded as "%HH" where HH is a two-digit hexidecimal ** representation of the character. The "/" character is not encoded ** by this routine. */ char *urlize(const char *z, int n){ return EncodeHttp(z, n, 0); } /* ** If input string does not contain quotes (niether ' nor ") ** then return the argument itself. Otherwise return a newly allocated ** copy of input with all quotes %-escaped. */ const char* escape_quotes(const char *zIn){ char *zRet, *zOut; size_t i, n = 0; for(i=0; zIn[i]; i++){ if( zIn[i]== '"' || zIn[i]== '\'' ) n++; } if( !n ) return zIn; zRet = zOut = fossil_malloc( i + 2*n + 1 ); for(i=0; zIn[i]; i++){ if( zIn[i]=='"' ){ *(zOut++) = '%'; *(zOut++) = '2'; *(zOut++) = '2'; }else if( zIn[i]=='\'' ){ *(zOut++) = '%'; *(zOut++) = '2'; *(zOut++) = '7'; }else{ *(zOut++) = zIn[i]; } } *zOut = 0; return zRet; } /* ** Convert a single HEX digit to an integer */ static int AsciiToHex(int c){ if( c>='a' && c<='f' ){ c += 10 - 'a'; |
︙ |
Changes to src/main.c.
︙ | |||
322 323 324 325 326 327 328 329 330 331 332 333 334 335 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | + | cson_value *v; cson_object *o; } reqPayload; /* request payload object (if any) */ cson_array *warnings; /* response warnings */ int timerId; /* fetched from fossil_timer_start() */ } json; #endif /* FOSSIL_ENABLE_JSON */ int ftntsIssues[4]; /* Counts for misref, strayed, joined, overnested */ int diffCnt[3]; /* Counts for DIFF_NUMSTAT: files, ins, del */ }; /* ** Macro for debugging: */ #define CGIDEBUG(X) if( g.fDebug ) cgi_debug X |
︙ |
Changes to src/markdown.c.
︙ | |||
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 78 79 80 81 82 83 84 85 86 87 88 89 90 | 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | + + + + + | }; /* mkd_renderer -- functions for rendering parsed data */ struct mkd_renderer { /* document level callbacks */ void (*prolog)(struct Blob *ob, void *opaque); void (*epilog)(struct Blob *ob, void *opaque); void (*footnotes)(struct Blob *ob, const struct Blob *items, void *opaque); /* block level callbacks - NULL skips the block */ void (*blockcode)(struct Blob *ob, struct Blob *text, void *opaque); void (*blockquote)(struct Blob *ob, struct Blob *text, void *opaque); void (*blockhtml)(struct Blob *ob, struct Blob *text, void *opaque); void (*header)(struct Blob *ob, struct Blob *text, int level, void *opaque); void (*hrule)(struct Blob *ob, void *opaque); void (*list)(struct Blob *ob, struct Blob *text, int flags, void *opaque); void (*listitem)(struct Blob *ob, struct Blob *text, int flags, void *opaque); void (*paragraph)(struct Blob *ob, struct Blob *text, void *opaque); void (*table)(struct Blob *ob, struct Blob *head_row, struct Blob *rows, void *opaque); void (*table_cell)(struct Blob *ob, struct Blob *text, int flags, void *opaque); void (*table_row)(struct Blob *ob, struct Blob *cells, int flags, void *opaque); void (*footnote_item)(struct Blob *ob, const struct Blob *text, int index, int nUsed, void *opaque); /* span level callbacks - NULL or return 0 prints the span verbatim */ int (*autolink)(struct Blob *ob, struct Blob *link, enum mkd_autolink type, void *opaque); int (*codespan)(struct Blob *ob, struct Blob *text, int nSep, void *opaque); int (*double_emphasis)(struct Blob *ob, struct Blob *text, char c, void *opaque); int (*emphasis)(struct Blob *ob, struct Blob *text, char c,void*opaque); int (*image)(struct Blob *ob, struct Blob *link, struct Blob *title, struct Blob *alt, void *opaque); int (*linebreak)(struct Blob *ob, void *opaque); int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title, struct Blob *content, void *opaque); int (*raw_html_tag)(struct Blob *ob, struct Blob *tag, void *opaque); int (*triple_emphasis)(struct Blob *ob, struct Blob *text, char c, void *opaque); int (*footnote_ref)(struct Blob *ob, const struct Blob *span, const struct Blob *upc, int index, int locus, void *opaque); /* low level callbacks - NULL copies input directly into the output */ void (*entity)(struct Blob *ob, struct Blob *entity, void *opaque); void (*normal_text)(struct Blob *ob, struct Blob *text, void *opaque); /* renderer data */ const char *emph_chars; /* chars that trigger emphasis rendering */ |
︙ | |||
111 112 113 114 115 116 117 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | + - + + - + + + + + - + + - + + + + + + + + + + + + + + + + + | /********************** * EXPORTED FUNCTIONS * **********************/ /* |
︙ | |||
154 155 156 157 158 159 160 | 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | - + + + + + + + + | struct render { struct mkd_renderer make; struct Blob refs; char_trigger active_char[256]; int iDepth; /* Depth of recursion */ int nBlobCache; /* Number of entries in aBlobCache */ struct Blob *aBlobCache[20]; /* Cache of Blobs available for reuse */ |
︙ | |||
181 182 183 184 185 186 187 | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - + - + + + | */ static const struct html_tag block_tags[] = { { "html", 4 }, { "pre", 3 }, { "script", 6 }, }; |
︙ | |||
245 246 247 248 249 250 251 252 253 254 255 256 257 258 | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | /* cmp_link_ref_sort -- comparison function for link_ref qsort */ static int cmp_link_ref_sort(const void *a, const void *b){ struct link_ref *lra = (void *)a; struct link_ref *lrb = (void *)b; return blob_compare(&lra->id, &lrb->id); } /* ** cmp_footnote_id -- comparison function for footnotes qsort. ** Empty IDs sort last (in undetermined order). ** Equal IDs are sorted in the order of definition in the source. */ static int cmp_footnote_id(const void *fna, const void *fnb){ const struct footnote *a = fna, *b = fnb; const int szA = blob_size(&a->id), szB = blob_size(&b->id); if( szA ){ if( szB ){ int cmp = blob_compare(&a->id, &b->id); if( cmp ) return cmp; }else return -1; }else return szB ? 1 : 0; /* IDs are equal and non-empty */ if( a->defno < b->defno ) return -1; if( a->defno > b->defno ) return 1; assert(!"reachable"); return 0; /* should never reach here */ } /* ** cmp_footnote_sort -- comparison function for footnotes qsort. ** Unreferenced footnotes (when nUsed == 0) sort last and ** are sorted in the order of definition in the source. */ static int cmp_footnote_sort(const void *fna, const void *fnb){ const struct footnote *a = fna, *b = fnb; int i, j; assert( a->nUsed >= 0 ); assert( b->nUsed >= 0 ); assert( a->defno >= 0 ); assert( b->defno >= 0 ); if( a->nUsed ){ assert( a->iMark > 0 ); if( !b->nUsed ) return -1; assert( b->iMark > 0 ); i = a->iMark; j = b->iMark; }else{ if( b->nUsed ) return 1; i = a->defno; j = b->defno; } if( i < j ) return -1; if( i > j ) return 1; return 0; } /* cmp_html_tag -- comparison function for bsearch() (stolen from discount) */ static int cmp_html_tag(const void *a, const void *b){ const struct html_tag *hta = a; const struct html_tag *htb = b; int sz = hta->size; int c; |
︙ | |||
577 578 579 580 581 582 583 | 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 | + - - + + + | if( fossil_isspace(before) ) return 0; if( fossil_isalnum(before) ) return 1; if( fossil_isalnum(after) ) return 0; return 1; } /* |
︙ | |||
622 623 624 625 626 627 628 | 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | - - + + + | release_work_buffer(rndr, work); return r ? i+1 : 0; } } return 0; } |
︙ | |||
661 662 663 664 665 666 667 | 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 | - - - + + + + | return r ? i+2 : 0; } i++; } return 0; } |
︙ | |||
709 710 711 712 713 714 715 | 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 | - - + + + | len = parse_emph2(ob, rndr, data-1, size+1, c); return len ? len-1 : 0; } } return 0; } |
︙ | |||
754 755 756 757 758 759 760 | 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 | - - + + + - - + + + | return 0; } return ret+3; } return 0; } |
︙ | |||
811 812 813 814 815 816 817 | 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 | + - + + - - - + + + + | }else{ if( !rndr->make.codespan(ob, 0, nb, rndr->make.opaque) ) end = 0; } return end; } /* |
︙ | |||
867 868 869 870 871 872 873 | 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 | - - + + + | rndr->make.entity(ob, &work, rndr->make.opaque); }else{ blob_append(ob, data, end); } return end; } |
︙ | |||
897 898 899 900 901 902 903 | 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 | - - + + | if( !ret ){ return 0; }else{ return end; } } |
︙ | |||
952 953 954 955 956 957 958 | 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 | - + + - + + + - + - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + - + + - + - - - - - - - - - - + + - - - - - - - - - - + - - - - - - - - + + + + + + + + + + + + + + + + - - + + - - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + - - - - - - + + + + + - - - - - + + + + - + - + + + + + + + + - | || data[link_e-1]=='\n') ){ link_e--; } /* remove optional angle brackets around the link */ if( data[link_b]=='<' ) link_b += 1; |
︙ | |||
1804 1805 1806 1807 1808 1809 1810 | 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 | + - + | if( !found ) return 0; /* the end of the block has been found */ if( strcmp(curtag->text,"html")==0 ){ /* Omit <html> tags */ enum mkd_autolink dummy; int k = tag_length(data, size, &dummy); int sz = i - (j+k); |
︙ | |||
2011 2012 2013 2014 2015 2016 2017 | 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 | + + - + | struct Blob *ob, /* output blob */ struct render *rndr, /* renderer internal state */ char *data, /* input text */ size_t size /* input text size */ ){ size_t beg, end, i; char *txt_data; int has_table; if( !size ) return; |
︙ | |||
2061 2062 2063 2064 2065 2066 2067 | 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 | - + | /********************* * REFERENCE PARSING * *********************/ /* is_ref -- returns whether a line is a reference or not */ static int is_ref( |
︙ | |||
2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 | 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 | + + | } } i += beg; /* id part: anything but a newline between brackets */ if( data[i]!='[' ) return 0; i++; if( i>=end || data[i]=='^' ) return 0; /* see is_footnote() */ id_offset = i; while( i<end && data[i]!='\n' && data[i]!='\r' && data[i]!=']' ){ i++; } if( i>=end || data[i]!=']' ) return 0; id_end = i; /* spacer: colon (space | tab)* newline? (space | tab)* */ i++; |
︙ | |||
2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 | 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 | + | && data[i]!=' ' && data[i]!='\t' && data[i]!='\n' && data[i]!='\r' ){ i += 1; } /* TODO: maybe require both data[i-1]=='>' && data[link_offset-1]=='<' ? */ if( data[i-1]=='>' ) link_end = i-1; else link_end = i; /* optional spacer: (space | tab)* (newline | '\'' | '"' | '(' ) */ while( i<end && (data[i]==' ' || data[i]=='\t') ){ i++; } if( i<end && data[i]!='\n' && data[i]!='\r' |
︙ | |||
2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 | 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + - + + + + + + + + + + + + - + + - + - - + + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | if( title_end>title_offset ){ blob_append(&lr.title, data+title_offset, title_end-title_offset); } blob_append(refs, (char *)&lr, sizeof lr); return 1; } /********************* * FOOTNOTE PARSING * *********************/ /* is_footnote -- check if data holds a definition of a labeled footnote. * If so then append the corresponding element to `footnotes` array */ static int is_footnote( const char *data, /* input text */ size_t beg, /* offset of the beginning of the line */ size_t end, /* offset of the end of the text */ size_t *last, /* last character of the link */ struct Blob * footnotes ){ size_t i, id_offset, id_end, upc_offset, upc_size; struct footnote fn = FOOTNOTE_INITIALIZER; /* failfast if data is too short */ if( beg+5>=end ) return 0; i = beg; /* footnote definition must start at the begining of a line */ if( data[i]!='[' ) return 0; i++; if( data[i]!='^' ) return 0; id_offset = ++i; /* id part: anything but a newline between brackets */ while( i<end && data[i]!=']' && data[i]!='\n' && data[i]!='\r' ){ i++; } if( i>=end || data[i]!=']' ) return 0; id_end = i++; /* spacer: colon (space | tab)* */ if( i>=end || data[i]!=':' ) return 0; i++; while( i<end && (data[i]==' ' || data[i]=='\t') ){ i++; } /* passthrough truncated footnote definition */ if( i>=end ) return 0; if( build_ref_id(&fn.id, data+id_offset, id_end-id_offset)<0 ) return 0; /* footnote's text may start on the same line after [^id]: */ upc_offset = upc_size = 0; if( data[i]!='\n' && data[i]!='\r' ){ size_t j; upc_size = is_footnote_classlist(data+i, end-i, 1); upc_offset = i; /* prevent further checks for a classlist */ i += upc_size; j = i; while( i<end && data[i]!='\n' && data[i]!='\r' ){ i++; }; if( i!=j )blob_append(&fn.text, data+j, i-j); if( i<end ){ blob_append_char(&fn.text, data[i]); i++; if( i<end && data[i]=='\n' && data[i-1]=='\r' ){ blob_append_char(&fn.text, data[i]); i++; } } }else{ i++; if( i<end && data[i]=='\n' && data[i-1]=='\r' ) i++; } if( i<end ){ /* compute the indentation from the 2nd line */ size_t indent = i; const char *spaces = data+i; while( indent<end && data[indent]==' ' ){ indent++; } if( indent>=end ) goto footnote_finish; indent -= i; if( indent<2 ) goto footnote_finish; /* process the 2nd and subsequent lines */ while( i+indent<end && memcmp(data+i,spaces,indent)==0 ){ size_t j; i += indent; if( !upc_offset ){ /* a classlist must be provided no later than at the 2nd line */ upc_offset = i + sizeof_blank_prefix(data+i, end-i, 1); upc_size = is_footnote_classlist(data+upc_offset, end-upc_offset, 1); if( upc_size ){ i = upc_offset + upc_size; } } j = i; while( i<end && data[i]!='\n' && data[i]!='\r' ){ i++; } if( i!=j ) blob_append(&fn.text, data+j, i-j); if( i>=end ) break; blob_append_char(&fn.text, data[i]); i++; if( i<end && data[i]=='\n' && data[i-1]=='\r' ){ blob_append_char(&fn.text, data[i]); i++; } } } footnote_finish: if( !blob_size(&fn.text) ){ blob_reset(&fn.id); return 0; } if( !blob_trim(&fn.text) ){ /* if the content is all-blank */ if( upc_size ){ /* interpret UPC as plain text */ blob_append(&fn.text, data+upc_offset, upc_size); upc_size = 0; }else{ blob_reset(&fn.id); /* or clean up and fail */ blob_reset(&fn.text); return 0; } } /* a valid note has been found */ if( last ) *last = i; if( footnotes ){ fn.defno = COUNT_FOOTNOTES( footnotes ); if( upc_size ){ assert( upc_offset && upc_offset+upc_size<end ); blob_append(&fn.upc, data+upc_offset, upc_size); } blob_append(footnotes, (char *)&fn, sizeof fn); } return 1; } /********************** * EXPORTED FUNCTIONS * **********************/ /* markdown -- parses the input buffer and renders it into the output buffer */ void markdown( struct Blob *ob, /* output blob for rendered text */ |
Changes to src/markdown.md.
︙ | |||
150 151 152 153 154 155 156 157 158 159 160 161 162 163 | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | > Formatted using [Pikchr](https://pikchr.org/home), resulting in: > ~~~ pikchr oval "Start" fit; arrow; box "Hello, World!" fit; arrow; oval "Done" fit ~~~ <a id="ftnts"></a> ## Footnotes ## > Footnotes (or "endnotes") is a Fossil's extention of classical Markdown. > Fossil's syntax for footnotes is similar to links and > is distinguished by the use of character **^** > that *immediately* follows an opening bracket. > 1. **\(^** footnote's text **)** > 2. **\[** fragment of text **]\(^** a comment about that fragment **\)** > 3. **\[^** label **\]** > 4. **\[** fragment of text **\]\[^** label **\]** > 5. **\[** fragment of text **\]\[^\]** > With formats 1 and 2 ("inline footnotes") text of a footnote is provided > in the place where the corresponding numeric mark will be rendered. > With formats 3, 4, and 5 ("reference footnotes") text of a footnote > is supplied elsewhere in the document, as shown below. > Formats 2, 4 and 5 ("span-specific footnotes") mark a specific fragment > that is being commented in the footnote. > Format 5 reuses a fragment of text as a label. > Labels are case-insensitive. > ``` > [^label]: Footnote definition must start on the first column. > The second line (if any) must be indented by two or more spaces. > Definition continues until indentation drops below that of the 2nd line. >``` > Character **^** is not part of a label, it is part of the syntax. > Both a footnote's text and a fragment to which a footnote applies > are subject to further interpretation as Markdown sources. ## Miscellaneous ## > * In-line images are made using **\!\[alt-text\]\(image-URL\)**. > * Use HTML for advanced formatting such as forms. > * **\<!--** HTML-style comments **-->** are supported. > * Escape special characters (ex: **\[** **\(** **\|** **\***) > using backslash (ex: **\\\[** **\\\(** **\\\|** **\\\***). |
︙ |
Changes to src/markdown_html.c.
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | void markdown_to_html( struct Blob *input_markdown, struct Blob *output_title, struct Blob *output_body); #endif /* INTERFACE */ /* ** Markdown-internal helper for generating unique link reference IDs. ** Fields provide typed interpretation of the underline memory buffer. */ typedef union bitfield64_t bitfield64_t; union bitfield64_t{ char c[8]; /* interpret as the array of signed characters */ unsigned char b[8]; /* interpret as the array of unsigned characters */ }; /* ** An instance of the following structure is passed through the ** "opaque" pointer. */ typedef struct MarkdownToHtml MarkdownToHtml; struct MarkdownToHtml { Blob *output_title; /* Store the title here */ bitfield64_t unique; /* Enables construction of unique #id elements */ #ifndef FOOTNOTES_WITHOUT_URI Blob reqURI; /* REQUEST_URI with escaped quotes */ #endif }; /* INTER_BLOCK -- skip a line between block level elements */ #define INTER_BLOCK(ob) \ do { if( blob_size(ob)>0 ) blob_append_char(ob, '\n'); } while (0) |
︙ | |||
76 77 78 79 80 81 82 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | - + - + - + - + - + | && data[i]!='\'' ){ i++; } blob_append(ob, data+beg, i-beg); while( i<size ){ if( data[i]=='<' ){ |
︙ | |||
106 107 108 109 110 111 112 | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + - + - + - + - + | && data[i]!='&' ){ i++; } blob_append(ob, data+beg, i-beg); while( i<size ){ if( data[i]=='<' ){ |
︙ | |||
155 156 157 158 159 160 161 | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | - + - + - + - - - + + + - + - + - + - + - + - + - - - + + + - + - - - + + + - + - + - + - + - + - + - + - + - - + + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + - + - + | ){ int nTag = html_tag_length(data); blob_append(title, data+nTag, size - nTag - 5); return; } INTER_BLOCK(ob); blob_append(ob, data, size); |
︙ | |||
420 421 422 423 424 425 426 | 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | - + - + | int nSep, /* Number of grave accents marks as delimiters */ void *opaque ){ if( text==0 ){ /* no-op */ }else if( nSep<=2 ){ /* One or two graves: an in-line code span */ |
︙ | |||
458 459 460 461 462 463 464 | 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 | - - - + + + - - - + + + - + - + - + - + - + | static int html_double_emphasis( struct Blob *ob, struct Blob *text, char c, void *opaque ){ |
︙ | |||
521 522 523 524 525 526 527 | 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | - + - + - - - + + + | static const int flags = WIKI_NOBADLINKS | WIKI_MARKDOWNLINKS ; wiki_resolve_hyperlink(ob, flags, zLink, zClose, sizeof(zClose), 0, zTitle); } if( blob_size(content)==0 ){ |
︙ | |||
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 | + + + + + + + + + + | struct Blob *output_title, /* Put title here. May be NULL */ struct Blob *output_body /* Put document body here. */ ){ struct mkd_renderer html_renderer = { /* prolog and epilog */ html_prolog, html_epilog, html_footnotes, /* block level elements */ html_blockcode, html_blockquote, html_blockhtml, html_header, html_hrule, html_list, html_list_item, html_paragraph, html_table, html_table_cell, html_table_row, html_footnote_item, /* span level elements */ html_autolink, html_codespan, html_double_emphasis, html_emphasis, html_image, html_linebreak, html_link, html_raw_html_tag, html_triple_emphasis, html_footnote_ref, /* low level elements */ 0, /* entity */ html_normal_text, /* misc. parameters */ "*_", /* emph_chars */ 0 /* opaque */ }; static int invocation = -1; /* no marker for the first document */ static const char* zRU = 0; /* REQUEST_URI with escaped quotes */ MarkdownToHtml context; memset(&context, 0, sizeof(context)); context.output_title = output_title; context.unique = to_base26(invocation++,1); if( !zRU ) zRU = escape_quotes(PD("REQUEST_URI","")); #ifndef FOOTNOTES_WITHOUT_URI blob_set( &context.reqURI, zRU ); #endif html_renderer.opaque = &context; if( output_title ) blob_reset(output_title); blob_reset(output_body); markdown(output_body, input_markdown, &html_renderer); } |
Changes to src/style.c.
︙ | |||
780 781 782 783 784 785 786 787 788 789 790 791 792 793 | 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 | + + + + + + + | stylesheet_url_var(); image_url_var("logo"); image_url_var("background"); if( !login_is_nobody() ){ Th_Store("login", g.zLogin); } Th_MaybeStore("current_feature", feature_from_page_path(local_zCurrentPage) ); if( g.ftntsIssues[0] || g.ftntsIssues[1] || g.ftntsIssues[2] || g.ftntsIssues[3] ){ char buf[80]; sprintf(&buf[0],"%i %i %i %i",g.ftntsIssues[0],g.ftntsIssues[1], g.ftntsIssues[2],g.ftntsIssues[3]); Th_Store("footnotes_issues_counters", buf); } } /* ** Draw the header. */ void style_header(const char *zTitleFormat, ...){ va_list ap; |
︙ |
Changes to src/wikiformat.c.
︙ | |||
1891 1892 1893 1894 1895 1896 1897 | 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 | - + + - + + + + + + + + + + + + | ** COMMAND: test-markdown-render ** ** Usage: %fossil test-markdown-render FILE ... ** ** Render markdown in FILE as HTML on stdout. ** Options: ** |
︙ |
Added test/markdown-test3.md.