Fossil SCM

Added '@' and '#' prefixes in spans. Initial commit ate them.

wyoung 2021-09-21 16:38 markdown-tagrefs
Commit 398cfa0be0c2f7ef52d01bc93ab58b75637608d703782af586ee617861bb3a1b
1 file changed +6 -5
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -540,26 +540,27 @@
540540
** Fossil feature using Markdown is free to apply markup and
541541
** behavior to these in feature-specific ways.
542542
*/
543543
static int html_tagspan(
544544
struct Blob *ob, /* Write the output here */
545
- struct Blob *text, /* The stuff in between the code span marks */
546
- enum mkd_tagspan type, /* which type of tagspan we're creating */
545
+ struct Blob *text, /* The word after the tag character */
546
+ enum mkd_tagspan type, /* Which type of tagspan we're creating */
547547
void *opaque
548548
){
549549
if( text==0 ){
550550
/* no-op */
551551
}else{
552
+ char c;
552553
BLOB_APPEND_LITERAL(ob, "<span data-");
553554
switch (type) {
554
- case MKDT_ATREF: BLOB_APPEND_LITERAL(ob, "atref"); break;
555
- case MKDT_HASH: BLOB_APPEND_LITERAL(ob, "hash"); break;
555
+ case MKDT_ATREF: c='@'; BLOB_APPEND_LITERAL(ob, "atref"); break;
556
+ case MKDT_HASH: c='#'; BLOB_APPEND_LITERAL(ob, "hash"); break;
556557
}
557558
BLOB_APPEND_LITERAL(ob, "=\"");
558559
html_quote(ob, blob_buffer(text), blob_size(text));
559560
BLOB_APPEND_LITERAL(ob, "\"");
560
- blob_appendf(ob, ">%b</span>", text);
561
+ blob_appendf(ob, ">%c%b</span>", c, text);
561562
}
562563
return 1;
563564
}
564565
565566
static int html_triple_emphasis(
566567
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -540,26 +540,27 @@
540 ** Fossil feature using Markdown is free to apply markup and
541 ** behavior to these in feature-specific ways.
542 */
543 static int html_tagspan(
544 struct Blob *ob, /* Write the output here */
545 struct Blob *text, /* The stuff in between the code span marks */
546 enum mkd_tagspan type, /* which type of tagspan we're creating */
547 void *opaque
548 ){
549 if( text==0 ){
550 /* no-op */
551 }else{
 
552 BLOB_APPEND_LITERAL(ob, "<span data-");
553 switch (type) {
554 case MKDT_ATREF: BLOB_APPEND_LITERAL(ob, "atref"); break;
555 case MKDT_HASH: BLOB_APPEND_LITERAL(ob, "hash"); break;
556 }
557 BLOB_APPEND_LITERAL(ob, "=\"");
558 html_quote(ob, blob_buffer(text), blob_size(text));
559 BLOB_APPEND_LITERAL(ob, "\"");
560 blob_appendf(ob, ">%b</span>", text);
561 }
562 return 1;
563 }
564
565 static int html_triple_emphasis(
566
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -540,26 +540,27 @@
540 ** Fossil feature using Markdown is free to apply markup and
541 ** behavior to these in feature-specific ways.
542 */
543 static int html_tagspan(
544 struct Blob *ob, /* Write the output here */
545 struct Blob *text, /* The word after the tag character */
546 enum mkd_tagspan type, /* Which type of tagspan we're creating */
547 void *opaque
548 ){
549 if( text==0 ){
550 /* no-op */
551 }else{
552 char c;
553 BLOB_APPEND_LITERAL(ob, "<span data-");
554 switch (type) {
555 case MKDT_ATREF: c='@'; BLOB_APPEND_LITERAL(ob, "atref"); break;
556 case MKDT_HASH: c='#'; BLOB_APPEND_LITERAL(ob, "hash"); break;
557 }
558 BLOB_APPEND_LITERAL(ob, "=\"");
559 html_quote(ob, blob_buffer(text), blob_size(text));
560 BLOB_APPEND_LITERAL(ob, "\"");
561 blob_appendf(ob, ">%c%b</span>", c, text);
562 }
563 return 1;
564 }
565
566 static int html_triple_emphasis(
567

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button