Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add markdown task list. See [forum:/forumpost/bb6016bc44|forum thread bb6016bc44]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | markdown-task-list |
| Files: | files | file ages | folders |
| SHA3-256: |
9583811be4b9e6cb0846822564ed536f |
| User & Date: | juef 2024-04-25 19:29:42.044 |
Context
|
2024-04-25
| ||
| 19:44 | Add to markdown task list inapplicable variant. ... (Leaf check-in: b3da5f144c user: juef tags: markdown-task-list) | |
| 19:29 | Add markdown task list. See [forum:/forumpost/bb6016bc44|forum thread bb6016bc44]. ... (check-in: 9583811be4 user: juef tags: markdown-task-list) | |
| 15:37 | Updates to the "hints and tricks" document. ... (check-in: 50a8a1bb70 user: drh tags: trunk) | |
Changes
Changes to src/default.css.
| ︙ | ︙ | |||
1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 |
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;
}
}
| > > > > | 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 |
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;
}
li.task-list {
list-style: none !important;
}
/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
.desktoponly {
display: none;
}
}
|
| ︙ | ︙ |
Changes to src/markdown.md.
| ︙ | ︙ | |||
82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
> A two-level list is created by placing additional whitespace before the
> **\***/**+**/**-**/**1.** of the secondary items.
> ~~~
* top-level item
* second-level item
~~~
## Block Quotes ##
> Begin each line of a paragraph with **>** to block quote that paragraph.
> >
> This paragraph is indented
| > > > > > > > | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
> A two-level list is created by placing additional whitespace before the
> **\***/**+**/**-**/**1.** of the secondary items.
> ~~~
* top-level item
* second-level item
~~~
> A task list is created by placing `[ ] ` before item; to mark as complete place `[x] `.
> ~~~
- [ ] Task
- [x] Completed task
~~~
## Block Quotes ##
> Begin each line of a paragraph with **>** to block quote that paragraph.
> >
> This paragraph is indented
|
| ︙ | ︙ |
Changes to src/markdown_html.c.
| ︙ | ︙ | |||
256 257 258 259 260 261 262 |
struct Blob *text,
int flags,
void *opaque
){
char *text_data = blob_buffer(text);
size_t text_size = blob_size(text);
while( text_size>0 && text_data[text_size-1]=='\n' ) text_size--;
| > > > > > > > > > > > | | > | 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 |
struct Blob *text,
int flags,
void *opaque
){
char *text_data = blob_buffer(text);
size_t text_size = blob_size(text);
while( text_size>0 && text_data[text_size-1]=='\n' ) text_size--;
if( strncmp("[ ] ", text_data, 4)==0 ){
blob_append_literal(ob, "<li class=\"task-list\">");
blob_append_literal(ob, "<input type=\"checkbox\" \
class=\"task-list-checkbox\" disabled>\n");
blob_append(ob, text_data+4, text_size-4);
}else if( sqlite3_strnicmp("[x] ", text_data, 4)==0 ){
blob_append_literal(ob, "<li class=\"task-list\">");
blob_append_literal(ob, "<input type=\"checkbox\" \
class=\"task-list-checkbox\" disabled checked>\n");
blob_append(ob, text_data+4, text_size-4);
}else{
blob_append_literal(ob, "<li>");
blob_append(ob, text_data, text_size);
}
blob_append_literal(ob, "</li>\n");
}
static void html_paragraph(struct Blob *ob, struct Blob *text, void *opaque){
INTER_BLOCK(ob);
blob_append_literal(ob, "<p>");
blob_appendb(ob, text);
|
| ︙ | ︙ |
Changes to src/wiki.wiki.
| ︙ | ︙ | |||
60 61 62 63 64 65 66 |
<a> <address> <article> <aside> <b>
<big> <blockquote> <br> <center> <cite>
<code> <col> <colgroup> <dd>
<del> <dfn>
<div> <dl> <dt> <em> <font> <footer>
<ins>
<h1> <h2> <h3> <h4> <h5> <h6>
| | | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
<a> <address> <article> <aside> <b>
<big> <blockquote> <br> <center> <cite>
<code> <col> <colgroup> <dd>
<del> <dfn>
<div> <dl> <dt> <em> <font> <footer>
<ins>
<h1> <h2> <h3> <h4> <h5> <h6>
<header> <hr> <i> <input> <img> <kbd> <li>
<nav> <nobr> <nowiki> <ol> <p> <pre>
<s> <samp> <section> <small> <span>
<strike> <strong> <sub> <sup> <table>
<tbody> <td> <tfoot> <th> <thead>
<title> <tr> <tt> <u> <ul> <var>
<verbatim>. There are two non-standard elements available:
<verbatim> and <nowiki>. No other elements are allowed.
|
| ︙ | ︙ |
Changes to src/wikiformat.c.
| ︙ | ︙ | |||
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
enum allowed_attr_t {
ATTR_ALIGN = 1,
ATTR_ALT,
ATTR_BGCOLOR,
ATTR_BORDER,
ATTR_CELLPADDING,
ATTR_CELLSPACING,
ATTR_CLASS,
ATTR_CLEAR,
ATTR_COLOR,
ATTR_COLSPAN,
ATTR_COMPACT,
ATTR_FACE,
ATTR_HEIGHT,
ATTR_HREF,
ATTR_HSPACE,
ATTR_ID,
ATTR_LINKS,
ATTR_NAME,
| > > | 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
enum allowed_attr_t {
ATTR_ALIGN = 1,
ATTR_ALT,
ATTR_BGCOLOR,
ATTR_BORDER,
ATTR_CELLPADDING,
ATTR_CELLSPACING,
ATTR_CHECKED,
ATTR_CLASS,
ATTR_CLEAR,
ATTR_COLOR,
ATTR_COLSPAN,
ATTR_COMPACT,
ATTR_DISABLED,
ATTR_FACE,
ATTR_HEIGHT,
ATTR_HREF,
ATTR_HSPACE,
ATTR_ID,
ATTR_LINKS,
ATTR_NAME,
|
| ︙ | ︙ | |||
78 79 80 81 82 83 84 |
enum amsk_t {
AMSK_ALIGN = 0x00000001,
AMSK_ALT = 0x00000002,
AMSK_BGCOLOR = 0x00000004,
AMSK_BORDER = 0x00000008,
AMSK_CELLPADDING = 0x00000010,
AMSK_CELLSPACING = 0x00000020,
| > | | | | | > | | | | | | | | | | | | | | | | | | | > > | | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 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 |
enum amsk_t {
AMSK_ALIGN = 0x00000001,
AMSK_ALT = 0x00000002,
AMSK_BGCOLOR = 0x00000004,
AMSK_BORDER = 0x00000008,
AMSK_CELLPADDING = 0x00000010,
AMSK_CELLSPACING = 0x00000020,
AMSK_CHECKED = 0x00000040,
AMSK_CLASS = 0x00000080,
AMSK_CLEAR = 0x00000100,
AMSK_COLOR = 0x00000200,
AMSK_COLSPAN = 0x00000400,
AMSK_COMPACT = 0x00000800,
AMSK_DISABLED = 0x00001000,
AMSK_FACE = 0x00002000,
AMSK_HEIGHT = 0x00004000,
AMSK_HREF = 0x00008000,
AMSK_HSPACE = 0x00010000,
AMSK_ID = 0x00020000,
AMSK_LINKS = 0x00040000,
AMSK_NAME = 0x00080000,
AMSK_ROWSPAN = 0x00100000,
AMSK_SIZE = 0x00200000,
AMSK_SRC = 0x00400000,
AMSK_START = 0x00800000,
AMSK_STYLE = 0x01000000,
AMSK_TARGET = 0x02000000,
AMSK_TITLE = 0x04000000,
AMSK_TYPE = 0x08000000,
AMSK_VALIGN = 0x10000000,
AMSK_VALUE = 0x20000000,
AMSK_VSPACE = 0x40000000,
AMSK_WIDTH = 0x80000000
};
static const struct AllowedAttribute {
const char *zName;
unsigned int iMask;
} aAttribute[] = {
/* These indexes MUST line up with their
corresponding allowed_attr_t enum values.
*/
{ 0, 0 },
{ "align", AMSK_ALIGN },
{ "alt", AMSK_ALT },
{ "bgcolor", AMSK_BGCOLOR },
{ "border", AMSK_BORDER },
{ "cellpadding", AMSK_CELLPADDING },
{ "cellspacing", AMSK_CELLSPACING },
{ "checked", AMSK_CHECKED },
{ "class", AMSK_CLASS },
{ "clear", AMSK_CLEAR },
{ "color", AMSK_COLOR },
{ "colspan", AMSK_COLSPAN },
{ "compact", AMSK_COMPACT },
{ "disabled", AMSK_DISABLED },
{ "face", AMSK_FACE },
{ "height", AMSK_HEIGHT },
{ "href", AMSK_HREF },
{ "hspace", AMSK_HSPACE },
{ "id", AMSK_ID },
{ "links", AMSK_LINKS },
{ "name", AMSK_NAME },
{ "rowspan", AMSK_ROWSPAN },
{ "size", AMSK_SIZE },
{ "src", AMSK_SRC },
{ "start", AMSK_START },
{ "style", AMSK_STYLE },
{ "target", AMSK_TARGET },
{ "title", AMSK_TITLE },
{ "type", AMSK_TYPE },
{ "valign", AMSK_VALIGN },
{ "value", AMSK_VALUE },
{ "vspace", AMSK_VSPACE },
{ "width", AMSK_WIDTH }
};
/*
** Use binary search to locate a tag in the aAttribute[] table.
*/
static int findAttr(const char *z){
int i, c, first, last;
|
| ︙ | ︙ | |||
210 211 212 213 214 215 216 217 218 219 220 221 222 223 | MARKUP_H3, MARKUP_H4, MARKUP_H5, MARKUP_H6, MARKUP_HTML5_HEADER, MARKUP_HR, MARKUP_I, MARKUP_IMG, MARKUP_INS, MARKUP_KBD, MARKUP_LI, MARKUP_HTML5_NAV, MARKUP_NOBR, MARKUP_NOWIKI, | > | 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | MARKUP_H3, MARKUP_H4, MARKUP_H5, MARKUP_H6, MARKUP_HTML5_HEADER, MARKUP_HR, MARKUP_I, MARKUP_INPUT, MARKUP_IMG, MARKUP_INS, MARKUP_KBD, MARKUP_LI, MARKUP_HTML5_NAV, MARKUP_NOBR, MARKUP_NOWIKI, |
| ︙ | ︙ | |||
333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
AMSK_ALIGN|AMSK_CLASS|AMSK_STYLE },
{ "header", MARKUP_HTML5_HEADER, MUTYPE_BLOCK,
AMSK_ID|AMSK_CLASS|AMSK_STYLE },
{ "hr", MARKUP_HR, MUTYPE_SINGLE,
AMSK_ALIGN|AMSK_COLOR|AMSK_SIZE|AMSK_WIDTH|
AMSK_STYLE|AMSK_CLASS },
{ "i", MARKUP_I, MUTYPE_FONT, AMSK_STYLE },
{ "img", MARKUP_IMG, MUTYPE_SINGLE,
AMSK_ALIGN|AMSK_ALT|AMSK_BORDER|AMSK_HEIGHT|
AMSK_HSPACE|AMSK_SRC|AMSK_VSPACE|AMSK_WIDTH|AMSK_STYLE },
{ "ins", MARKUP_INS, MUTYPE_FONT, AMSK_STYLE },
{ "kbd", MARKUP_KBD, MUTYPE_FONT, AMSK_STYLE },
{ "li", MARKUP_LI, MUTYPE_LI,
AMSK_TYPE|AMSK_VALUE|AMSK_STYLE },
| > > | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
AMSK_ALIGN|AMSK_CLASS|AMSK_STYLE },
{ "header", MARKUP_HTML5_HEADER, MUTYPE_BLOCK,
AMSK_ID|AMSK_CLASS|AMSK_STYLE },
{ "hr", MARKUP_HR, MUTYPE_SINGLE,
AMSK_ALIGN|AMSK_COLOR|AMSK_SIZE|AMSK_WIDTH|
AMSK_STYLE|AMSK_CLASS },
{ "i", MARKUP_I, MUTYPE_FONT, AMSK_STYLE },
{ "input", MARKUP_INPUT, MUTYPE_SINGLE,
AMSK_CHECKED|AMSK_CLASS|AMSK_DISABLED|AMSK_TYPE },
{ "img", MARKUP_IMG, MUTYPE_SINGLE,
AMSK_ALIGN|AMSK_ALT|AMSK_BORDER|AMSK_HEIGHT|
AMSK_HSPACE|AMSK_SRC|AMSK_VSPACE|AMSK_WIDTH|AMSK_STYLE },
{ "ins", MARKUP_INS, MUTYPE_FONT, AMSK_STYLE },
{ "kbd", MARKUP_KBD, MUTYPE_FONT, AMSK_STYLE },
{ "li", MARKUP_LI, MUTYPE_LI,
AMSK_TYPE|AMSK_VALUE|AMSK_STYLE },
|
| ︙ | ︙ |