Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add markdown extra emphasis chars. See [forum:/forumpost/3618539728|forum thread 3618539728]. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | markdown-extra-emph-chars |
| Files: | files | file ages | folders |
| SHA3-256: |
bade58d57978d82e695f9612ac03c18f |
| User & Date: | juef 2024-04-25 19:29:28.519 |
Context
|
2024-04-25
| ||
| 19:29 | Add markdown extra emphasis chars. See [forum:/forumpost/3618539728|forum thread 3618539728]. ... (Leaf check-in: bade58d579 user: juef tags: markdown-extra-emph-chars) | |
| 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 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 |
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;
}
del {
text-decoration: line-through;
background-color: #fbb;
color: #555;
}
ins {
text-decoration: none;
background-color: #d4fcbc;
}
mark {
background-color: #f4fce3;
}
/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
.desktoponly {
display: none;
}
}
|
| ︙ | ︙ |
Changes to src/markdown.md.
| ︙ | ︙ | |||
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | > In format 8, then the URL becomes the display text. This is useful for > hyperlinks that refer to wiki pages and check-in and ticket hashes. ## Text Style ## > * _\*italic\*_ > * *\_italic\_* > * __\*\*bold\*\*__ > * **\_\_bold\_\_** > * ___\*\*\*italic+bold\*\*\*___ > * ***\_\_\_italic+bold\_\_\_*** > * \``code`\` > The **\`code\`** construct disables HTML markup, so one can write, for > example, **\`\<html\>\`** to yield **`<html>`**. | > > > > > > | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | > In format 8, then the URL becomes the display text. This is useful for > hyperlinks that refer to wiki pages and check-in and ticket hashes. ## Text Style ## > * _\*italic\*_ > * *\_italic\_* > * subscript: \~text\~, e.g. H~2~O > * supscript: \^text\^, e.g. E=mc^2^ > * ++\+\+inserted text\+\+++ > * --\-\-deleted text\-\--- > * ==\=\=mark\=\=== > * __\*\*bold\*\*__ > * **\_\_bold\_\_** > * ~~\~\~strikethrough\~\~~~ > * ___\*\*\*italic+bold\*\*\*___ > * ***\_\_\_italic+bold\_\_\_*** > * \``code`\` > The **\`code\`** construct disables HTML markup, so one can write, for > example, **\`\<html\>\`** to yield **`<html>`**. |
| ︙ | ︙ |
Changes to src/markdown_html.c.
| ︙ | ︙ | |||
748 749 750 751 752 753 754 755 756 757 758 759 760 761 |
j-k, z+k, n-i, z+i);
}
}
}
}
return 1;
}
static int html_double_emphasis(
struct Blob *ob,
struct Blob *text,
char c,
void *opaque
){
| > > > > > > > > > > | | > > > | | | > | | 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 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 |
j-k, z+k, n-i, z+i);
}
}
}
}
return 1;
}
static void html_span(
struct Blob *ob,
struct Blob *text,
const char *tag
){
blob_appendf(ob, "<%s>", tag);
blob_appendb(ob, text);
blob_appendf(ob, "</%s>", tag);
}
static int html_double_emphasis(
struct Blob *ob,
struct Blob *text,
char c,
void *opaque
){
if( c=='~' ) html_span(ob, text, "s");
else if( c=='-' ) html_span(ob, text, "del");
else if( c=='+' ) html_span(ob, text, "ins");
else if( c=='=' ) html_span(ob, text, "mark");
else if( c=='^' ) return 0;
else html_span(ob, text, "strong");
return 1;
}
static int html_emphasis(
struct Blob *ob,
struct Blob *text,
char c,
void *opaque
){
if( c=='~' ) html_span(ob, text, "sub");
else if( c=='^' ) html_span(ob, text, "sup");
else if( c=='-' || c=='+' || c=='=' ) return 0;
else html_span(ob, text, "em");
return 1;
}
static int html_image(
struct Blob *ob,
struct Blob *link,
struct Blob *title,
|
| ︙ | ︙ | |||
832 833 834 835 836 837 838 839 840 841 842 843 844 845 |
static int html_triple_emphasis(
struct Blob *ob,
struct Blob *text,
char c,
void *opaque
){
blob_append_literal(ob, "<strong><em>");
blob_appendb(ob, text);
blob_append_literal(ob, "</em></strong>");
return 1;
}
| > | 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 |
static int html_triple_emphasis(
struct Blob *ob,
struct Blob *text,
char c,
void *opaque
){
if( c!='*' && c!='_' ) return 0;
blob_append_literal(ob, "<strong><em>");
blob_appendb(ob, text);
blob_append_literal(ob, "</em></strong>");
return 1;
}
|
| ︙ | ︙ | |||
891 892 893 894 895 896 897 |
html_footnote_ref,
/* low level elements */
0, /* entity */
html_normal_text,
/* misc. parameters */
| | | 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 |
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;
|
| ︙ | ︙ |
Changes to src/wiki.wiki.
| ︙ | ︙ | |||
61 62 63 64 65 66 67 |
<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> <img> <kbd> <li>
| | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
<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> <img> <kbd> <li>
<mark> <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.
All attributes are checked and only a few benign attributes are
allowed on each element. In particular, any attributes that specify
|
| ︙ | ︙ |
Changes to src/wikiformat.c.
| ︙ | ︙ | |||
214 215 216 217 218 219 220 221 222 223 224 225 226 227 | MARKUP_HTML5_HEADER, MARKUP_HR, MARKUP_I, MARKUP_IMG, MARKUP_INS, MARKUP_KBD, MARKUP_LI, MARKUP_HTML5_NAV, MARKUP_NOBR, MARKUP_NOWIKI, MARKUP_OL, MARKUP_P, MARKUP_PRE, MARKUP_S, | > | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | MARKUP_HTML5_HEADER, MARKUP_HR, MARKUP_I, MARKUP_IMG, MARKUP_INS, MARKUP_KBD, MARKUP_LI, MARKUP_MARK, MARKUP_HTML5_NAV, MARKUP_NOBR, MARKUP_NOWIKI, MARKUP_OL, MARKUP_P, MARKUP_PRE, MARKUP_S, |
| ︙ | ︙ | |||
340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
{ "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 },
{ "nav", MARKUP_HTML5_NAV, MUTYPE_BLOCK,
AMSK_ID|AMSK_CLASS|AMSK_STYLE },
{ "nobr", MARKUP_NOBR, MUTYPE_FONT, 0 },
{ "nowiki", MARKUP_NOWIKI, MUTYPE_SPECIAL, 0 },
{ "ol", MARKUP_OL, MUTYPE_LIST,
AMSK_START|AMSK_TYPE|AMSK_COMPACT|AMSK_STYLE },
{ "p", MARKUP_P, MUTYPE_BLOCK,
| > | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
{ "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 },
{ "mark", MARKUP_MARK, MUTYPE_BLOCK, 0 },
{ "nav", MARKUP_HTML5_NAV, MUTYPE_BLOCK,
AMSK_ID|AMSK_CLASS|AMSK_STYLE },
{ "nobr", MARKUP_NOBR, MUTYPE_FONT, 0 },
{ "nowiki", MARKUP_NOWIKI, MUTYPE_SPECIAL, 0 },
{ "ol", MARKUP_OL, MUTYPE_LIST,
AMSK_START|AMSK_TYPE|AMSK_COMPACT|AMSK_STYLE },
{ "p", MARKUP_P, MUTYPE_BLOCK,
|
| ︙ | ︙ |