Fossil SCM

Strip out the disabled #hashtag support. It turns out there is plenty of content which could get mangled by this, such as hex-form HTML entities. That is: the risk of what amounts to content rendering corruption is always there. [forum:3774a95d2072a595|Associated discussion.]

stephan 2026-11-16 11:41 UTC trunk
Commit 7e8ecf0ce4a3c05aa39de7ffe2828d23e334efe446ef2387e09f205ef00b2227
--- src/backlink.c
+++ src/backlink.c
@@ -284,14 +284,10 @@
284284
static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; }
285285
static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char,
286286
void*) = mkdn_noop_emphasis;
287287
static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3,
288288
int i1, int i2, void *v){ return 1; }
289
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
290
-static int mkdn_noop_tagref(Blob *b1,Blob *b2, enum mkd_tagspan t,
291
- void *p){ return 1; }
292
-#endif
293289
294290
/*
295291
** Scan markdown text and add self-hyperlinks to the BACKLINK table.
296292
*/
297293
void markdown_extract_links(
@@ -322,13 +318,10 @@
322318
/* emphasis */ mkdn_noop_emphasis,
323319
/* image */ mkdn_noop_image,
324320
/* linebreak */ mkdn_noop_linebreak,
325321
/* link */ backlink_md_link,
326322
/* r_html_tag */ mkdn_noop_r_html_tag,
327
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
328
- /* #tags */ mkdn_noop_tagref,
329
-#endif
330323
/* tri_emphas */ mkdn_noop_tri_emphas,
331324
/* footnoteref*/ mkdn_noop_footnoteref,
332325
333326
0, /* entity */
334327
0, /* normal_text */
335328
--- src/backlink.c
+++ src/backlink.c
@@ -284,14 +284,10 @@
284 static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; }
285 static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char,
286 void*) = mkdn_noop_emphasis;
287 static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3,
288 int i1, int i2, void *v){ return 1; }
289 #if defined(MARKDOWN_ENABLE_TAGSPAN)
290 static int mkdn_noop_tagref(Blob *b1,Blob *b2, enum mkd_tagspan t,
291 void *p){ return 1; }
292 #endif
293
294 /*
295 ** Scan markdown text and add self-hyperlinks to the BACKLINK table.
296 */
297 void markdown_extract_links(
@@ -322,13 +318,10 @@
322 /* emphasis */ mkdn_noop_emphasis,
323 /* image */ mkdn_noop_image,
324 /* linebreak */ mkdn_noop_linebreak,
325 /* link */ backlink_md_link,
326 /* r_html_tag */ mkdn_noop_r_html_tag,
327 #if defined(MARKDOWN_ENABLE_TAGSPAN)
328 /* #tags */ mkdn_noop_tagref,
329 #endif
330 /* tri_emphas */ mkdn_noop_tri_emphas,
331 /* footnoteref*/ mkdn_noop_footnoteref,
332
333 0, /* entity */
334 0, /* normal_text */
335
--- src/backlink.c
+++ src/backlink.c
@@ -284,14 +284,10 @@
284 static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; }
285 static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char,
286 void*) = mkdn_noop_emphasis;
287 static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3,
288 int i1, int i2, void *v){ return 1; }
 
 
 
 
289
290 /*
291 ** Scan markdown text and add self-hyperlinks to the BACKLINK table.
292 */
293 void markdown_extract_links(
@@ -322,13 +318,10 @@
318 /* emphasis */ mkdn_noop_emphasis,
319 /* image */ mkdn_noop_image,
320 /* linebreak */ mkdn_noop_linebreak,
321 /* link */ backlink_md_link,
322 /* r_html_tag */ mkdn_noop_r_html_tag,
 
 
 
323 /* tri_emphas */ mkdn_noop_tri_emphas,
324 /* footnoteref*/ mkdn_noop_footnoteref,
325
326 0, /* entity */
327 0, /* normal_text */
328
--- src/markdown.c
+++ src/markdown.c
@@ -86,14 +86,10 @@
8686
struct Blob *alt, void *opaque);
8787
int (*linebreak)(struct Blob *ob, void *opaque);
8888
int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title,
8989
struct Blob *content, void *opaque);
9090
int (*raw_html_tag)(struct Blob *ob, struct Blob *tag, void *opaque);
91
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
92
- int (*tagspan)(struct Blob *ob, struct Blob *ref, enum mkd_tagspan type,
93
- void *opaque);
94
-#endif
9591
int (*triple_emphasis)(struct Blob *ob, struct Blob *text,
9692
char c, void *opaque);
9793
int (*footnote_ref)(struct Blob *ob, const struct Blob *span,
9894
const struct Blob *upc, int index, int locus, void *opaque);
9995
@@ -961,165 +957,10 @@
961957
blob_append(ob, data, end);
962958
}
963959
return end;
964960
}
965961
966
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
967
-/* char_hashref_tag -- '#' followed by "word" characters to tag
968
-** post numbers, hashtags, etc.
969
-**
970
-** Basic syntax:
971
-**
972
-** ^[a-zA-Z]X*
973
-**
974
-** Where X is:
975
-**
976
-** - Any number of alphanumeric characters.
977
-**
978
-** - Single underscores. Adjacent underscores are not recognized
979
-** as valid hashtags. That decision is somewhat arbitrary
980
-** and up for debate.
981
-**
982
-** Hashtags must end at the end of input or be followed by whitespace
983
-** or what appears to be the end or separator of a logical
984
-** natural-language construct, e.g. period, colon, etc.
985
-**
986
-** Current limitations of this implementation:
987
-**
988
-** - Currently requires starting alpha and trailing
989
-** alphanumeric or underscores. "Should" be extended to
990
-** handle #X[.Y], where X and optional Y are integer
991
-** values, for forum post references.
992
-*/
993
-static size_t char_hashref_tag(
994
- struct Blob *ob,
995
- struct render *rndr,
996
- char *data,
997
- size_t offset,
998
- size_t size
999
-){
1000
- size_t end;
1001
- struct Blob work = BLOB_INITIALIZER;
1002
- int nUscore = 0; /* Consecutive underscore counter */
1003
- int numberMode = 0 /* 0 for normal, 1 for #NNN numeric,
1004
- and 2 for #NNN.NNN. */;
1005
- if(offset>0 && !fossil_isspace(data[-1])){
1006
- /* Only ever match if the *previous* character is whitespace or
1007
- ** we're at the start of the input. Note that we rely on fossil
1008
- ** processing emphasis markup before reaching this function, so
1009
- ** *#Hash* will Do The Right Thing. Not that this means that
1010
- ** "#Hash." will match while ".#Hash" won't. That's okay. */
1011
- return 0;
1012
- }
1013
- assert( '#' == data[0] );
1014
- if(size < 2) return 0;
1015
- end = 2;
1016
- if(fossil_isdigit(data[1])){
1017
- numberMode = 1;
1018
- }else if(!fossil_isalpha(data[1])){
1019
- switch(data[1] & 0xF0){
1020
- /* Reminder: UTF8 char lengths can be determined by
1021
- ** masking against 0xF0: 0xf0==4, 0xe0==3, 0xc0==2,
1022
- ** else 1. */
1023
- case 0xF0: end+=3; break;
1024
- case 0xE0: end+=2; break;
1025
- case 0xC0: end+=1; break;
1026
- default: return 0;
1027
- }
1028
- }
1029
-#if 0
1030
- fprintf(stderr,"HASHREF offset=%d size=%d: %.*s\n",
1031
- (int)offset, (int)size, (int)size, data);
1032
-#endif
1033
-#define HASHTAG_LEGAL_END \
1034
- case ' ': case '\t': case '\r': case '\n': \
1035
- case ':': case ';': case '!': case '?': case ','
1036
- /* ^^^^ '.' is handled separately */
1037
- for(; end < size; ++end){
1038
- char ch = data[end];
1039
- switch(ch & 0xF0){
1040
- case 0xF0: end+=3; continue;
1041
- case 0xE0: end+=2; continue;
1042
- case 0xC0: end+=1; continue;
1043
- case 0x80: goto hashref_bailout /*invalid UTF8*/;
1044
- default: break;
1045
- }
1046
-#if 0
1047
- fprintf(stderr,"hashtag? checking... length=%d: %.*s\n",
1048
- (int)end, (int)end, data);
1049
-#endif
1050
- switch(ch){
1051
- case '_':
1052
- /* Multiple adjacent underscores not permitted. */
1053
- if(++nUscore>1) goto hashref_bailout;
1054
- numberMode = 0;
1055
- break;
1056
- case '.':
1057
- if(1==numberMode) ++numberMode;
1058
- ch = 0;
1059
- break;
1060
- HASHTAG_LEGAL_END:
1061
- ch = 0;
1062
- break;
1063
- case '0': case '1': case '2': case '3': case '4':
1064
- case '5': case '6': case '7': case '8': case '9':
1065
- nUscore = 0;
1066
- break;
1067
- default:
1068
- if(numberMode || !fossil_isalpha(ch)){
1069
- goto hashref_bailout;
1070
- }
1071
- nUscore = 0;
1072
- break;
1073
- }
1074
- if(ch) continue;
1075
- break;
1076
- }
1077
- if((end<3/* #. or some such */ && !numberMode)
1078
- || end>size/*from truncated multi-byte char*/){
1079
- return 0;
1080
- }
1081
- if(numberMode>1){
1082
- /* Check for trailing part of #NNN.nnn... */
1083
- assert('.'==data[end]);
1084
- if(end<size-1 && fossil_isdigit(data[end+1])){
1085
- for(++end; end<size; ++end){
1086
- if(!fossil_isdigit(data[end])) break;
1087
- }
1088
- }
1089
- }
1090
-#if 0
1091
- fprintf(stderr,"???HASHREF length=%d: %.*s\n",
1092
- (int)end, (int)end, data);
1093
-#endif
1094
- if(end<size){
1095
- /* Only match if we end at end of input or what "might" be the end
1096
- of a natural language grammar construct, e.g. period or
1097
- [semi]colon. */
1098
- switch(data[end]){
1099
- case '.':
1100
- HASHTAG_LEGAL_END:
1101
- break;
1102
- default:
1103
- goto hashref_bailout;
1104
- }
1105
- }
1106
- blob_init(&work, data + 1, end - 1);
1107
- rndr->make.tagspan(ob, &work,
1108
- numberMode ? MKDT_NUMTAG : MKDT_HASHTAG,
1109
- rndr->make.opaque);
1110
- return end;
1111
- hashref_bailout:
1112
-#if 0
1113
- fprintf(stderr,"BAILING HASHREF examined=%d:\n[%.*s] of\n[%.*s]\n",
1114
- (int)end, (int)end, data, (int)size, data);
1115
-#endif
1116
-#undef HASHTAG_LEGAL_END
1117
- return 0;
1118
-}
1119
-#endif /* MARKDOWN_ENABLE_TAGSPAN */
1120
-
1121962
/*
1122963
** char_langle_tag -- '<' when tags or autolinks are allowed.
1123964
*/
1124965
static size_t char_langle_tag(
1125966
struct Blob *ob,
@@ -2856,13 +2697,10 @@
28562697
}
28572698
}
28582699
if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan;
28592700
if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak;
28602701
if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link;
2861
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
2862
- rndr.active_char['#'] = char_hashref_tag;
2863
-#endif
28642702
if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote;
28652703
rndr.active_char['<'] = char_langle_tag;
28662704
rndr.active_char['\\'] = char_escape;
28672705
rndr.active_char['&'] = char_entity;
28682706
28692707
--- src/markdown.c
+++ src/markdown.c
@@ -86,14 +86,10 @@
86 struct Blob *alt, void *opaque);
87 int (*linebreak)(struct Blob *ob, void *opaque);
88 int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title,
89 struct Blob *content, void *opaque);
90 int (*raw_html_tag)(struct Blob *ob, struct Blob *tag, void *opaque);
91 #if defined(MARKDOWN_ENABLE_TAGSPAN)
92 int (*tagspan)(struct Blob *ob, struct Blob *ref, enum mkd_tagspan type,
93 void *opaque);
94 #endif
95 int (*triple_emphasis)(struct Blob *ob, struct Blob *text,
96 char c, void *opaque);
97 int (*footnote_ref)(struct Blob *ob, const struct Blob *span,
98 const struct Blob *upc, int index, int locus, void *opaque);
99
@@ -961,165 +957,10 @@
961 blob_append(ob, data, end);
962 }
963 return end;
964 }
965
966 #if defined(MARKDOWN_ENABLE_TAGSPAN)
967 /* char_hashref_tag -- '#' followed by "word" characters to tag
968 ** post numbers, hashtags, etc.
969 **
970 ** Basic syntax:
971 **
972 ** ^[a-zA-Z]X*
973 **
974 ** Where X is:
975 **
976 ** - Any number of alphanumeric characters.
977 **
978 ** - Single underscores. Adjacent underscores are not recognized
979 ** as valid hashtags. That decision is somewhat arbitrary
980 ** and up for debate.
981 **
982 ** Hashtags must end at the end of input or be followed by whitespace
983 ** or what appears to be the end or separator of a logical
984 ** natural-language construct, e.g. period, colon, etc.
985 **
986 ** Current limitations of this implementation:
987 **
988 ** - Currently requires starting alpha and trailing
989 ** alphanumeric or underscores. "Should" be extended to
990 ** handle #X[.Y], where X and optional Y are integer
991 ** values, for forum post references.
992 */
993 static size_t char_hashref_tag(
994 struct Blob *ob,
995 struct render *rndr,
996 char *data,
997 size_t offset,
998 size_t size
999 ){
1000 size_t end;
1001 struct Blob work = BLOB_INITIALIZER;
1002 int nUscore = 0; /* Consecutive underscore counter */
1003 int numberMode = 0 /* 0 for normal, 1 for #NNN numeric,
1004 and 2 for #NNN.NNN. */;
1005 if(offset>0 && !fossil_isspace(data[-1])){
1006 /* Only ever match if the *previous* character is whitespace or
1007 ** we're at the start of the input. Note that we rely on fossil
1008 ** processing emphasis markup before reaching this function, so
1009 ** *#Hash* will Do The Right Thing. Not that this means that
1010 ** "#Hash." will match while ".#Hash" won't. That's okay. */
1011 return 0;
1012 }
1013 assert( '#' == data[0] );
1014 if(size < 2) return 0;
1015 end = 2;
1016 if(fossil_isdigit(data[1])){
1017 numberMode = 1;
1018 }else if(!fossil_isalpha(data[1])){
1019 switch(data[1] & 0xF0){
1020 /* Reminder: UTF8 char lengths can be determined by
1021 ** masking against 0xF0: 0xf0==4, 0xe0==3, 0xc0==2,
1022 ** else 1. */
1023 case 0xF0: end+=3; break;
1024 case 0xE0: end+=2; break;
1025 case 0xC0: end+=1; break;
1026 default: return 0;
1027 }
1028 }
1029 #if 0
1030 fprintf(stderr,"HASHREF offset=%d size=%d: %.*s\n",
1031 (int)offset, (int)size, (int)size, data);
1032 #endif
1033 #define HASHTAG_LEGAL_END \
1034 case ' ': case '\t': case '\r': case '\n': \
1035 case ':': case ';': case '!': case '?': case ','
1036 /* ^^^^ '.' is handled separately */
1037 for(; end < size; ++end){
1038 char ch = data[end];
1039 switch(ch & 0xF0){
1040 case 0xF0: end+=3; continue;
1041 case 0xE0: end+=2; continue;
1042 case 0xC0: end+=1; continue;
1043 case 0x80: goto hashref_bailout /*invalid UTF8*/;
1044 default: break;
1045 }
1046 #if 0
1047 fprintf(stderr,"hashtag? checking... length=%d: %.*s\n",
1048 (int)end, (int)end, data);
1049 #endif
1050 switch(ch){
1051 case '_':
1052 /* Multiple adjacent underscores not permitted. */
1053 if(++nUscore>1) goto hashref_bailout;
1054 numberMode = 0;
1055 break;
1056 case '.':
1057 if(1==numberMode) ++numberMode;
1058 ch = 0;
1059 break;
1060 HASHTAG_LEGAL_END:
1061 ch = 0;
1062 break;
1063 case '0': case '1': case '2': case '3': case '4':
1064 case '5': case '6': case '7': case '8': case '9':
1065 nUscore = 0;
1066 break;
1067 default:
1068 if(numberMode || !fossil_isalpha(ch)){
1069 goto hashref_bailout;
1070 }
1071 nUscore = 0;
1072 break;
1073 }
1074 if(ch) continue;
1075 break;
1076 }
1077 if((end<3/* #. or some such */ && !numberMode)
1078 || end>size/*from truncated multi-byte char*/){
1079 return 0;
1080 }
1081 if(numberMode>1){
1082 /* Check for trailing part of #NNN.nnn... */
1083 assert('.'==data[end]);
1084 if(end<size-1 && fossil_isdigit(data[end+1])){
1085 for(++end; end<size; ++end){
1086 if(!fossil_isdigit(data[end])) break;
1087 }
1088 }
1089 }
1090 #if 0
1091 fprintf(stderr,"???HASHREF length=%d: %.*s\n",
1092 (int)end, (int)end, data);
1093 #endif
1094 if(end<size){
1095 /* Only match if we end at end of input or what "might" be the end
1096 of a natural language grammar construct, e.g. period or
1097 [semi]colon. */
1098 switch(data[end]){
1099 case '.':
1100 HASHTAG_LEGAL_END:
1101 break;
1102 default:
1103 goto hashref_bailout;
1104 }
1105 }
1106 blob_init(&work, data + 1, end - 1);
1107 rndr->make.tagspan(ob, &work,
1108 numberMode ? MKDT_NUMTAG : MKDT_HASHTAG,
1109 rndr->make.opaque);
1110 return end;
1111 hashref_bailout:
1112 #if 0
1113 fprintf(stderr,"BAILING HASHREF examined=%d:\n[%.*s] of\n[%.*s]\n",
1114 (int)end, (int)end, data, (int)size, data);
1115 #endif
1116 #undef HASHTAG_LEGAL_END
1117 return 0;
1118 }
1119 #endif /* MARKDOWN_ENABLE_TAGSPAN */
1120
1121 /*
1122 ** char_langle_tag -- '<' when tags or autolinks are allowed.
1123 */
1124 static size_t char_langle_tag(
1125 struct Blob *ob,
@@ -2856,13 +2697,10 @@
2856 }
2857 }
2858 if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan;
2859 if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak;
2860 if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link;
2861 #if defined(MARKDOWN_ENABLE_TAGSPAN)
2862 rndr.active_char['#'] = char_hashref_tag;
2863 #endif
2864 if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote;
2865 rndr.active_char['<'] = char_langle_tag;
2866 rndr.active_char['\\'] = char_escape;
2867 rndr.active_char['&'] = char_entity;
2868
2869
--- src/markdown.c
+++ src/markdown.c
@@ -86,14 +86,10 @@
86 struct Blob *alt, void *opaque);
87 int (*linebreak)(struct Blob *ob, void *opaque);
88 int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title,
89 struct Blob *content, void *opaque);
90 int (*raw_html_tag)(struct Blob *ob, struct Blob *tag, void *opaque);
 
 
 
 
91 int (*triple_emphasis)(struct Blob *ob, struct Blob *text,
92 char c, void *opaque);
93 int (*footnote_ref)(struct Blob *ob, const struct Blob *span,
94 const struct Blob *upc, int index, int locus, void *opaque);
95
@@ -961,165 +957,10 @@
957 blob_append(ob, data, end);
958 }
959 return end;
960 }
961
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962 /*
963 ** char_langle_tag -- '<' when tags or autolinks are allowed.
964 */
965 static size_t char_langle_tag(
966 struct Blob *ob,
@@ -2856,13 +2697,10 @@
2697 }
2698 }
2699 if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan;
2700 if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak;
2701 if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link;
 
 
 
2702 if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote;
2703 rndr.active_char['<'] = char_langle_tag;
2704 rndr.active_char['\\'] = char_escape;
2705 rndr.active_char['&'] = char_entity;
2706
2707
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -870,47 +870,10 @@
870870
blob_appendb(ob, content);
871871
}
872872
blob_append(ob, zClose, -1);
873873
return 1;
874874
}
875
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
876
-/* 2026-11-04: if a document has an embedded style tag and that tag
877
-** uses #rgb colors, they get parsed as hashtags. We do not yet
878
-** have a way of distinguishing that case and these produce broken
879
-** documents, so disabling #hashtags until this can be resolved. */
880
-/* Invoked for @name and #tag tagged words, marked up in the
881
-** output text in a way that JS and CSS can do something
882
-** interesting with them. This isn't standard Markdown, so
883
-** it's implementation-specific what occurs here. More, each
884
-** Fossil feature using Markdown is free to apply styling and
885
-** behavior to these in feature-specific ways.
886
-*/
887
-static int html_tagspan(
888
- struct Blob *ob, /* Write the output here */
889
- struct Blob *text, /* The word after the tag character */
890
- enum mkd_tagspan type, /* Which type of tagspan we're creating */
891
- void *opaque
892
-){
893
- if( text==0 ){
894
- /* no-op */
895
- }else{
896
- char cPrefix = '!';
897
- blob_append_literal(ob, "<span data-");
898
- switch (type) {
899
- case MKDT_HASHTAG:
900
- cPrefix = '#'; blob_append_literal(ob, "hashtag"); break;
901
- case MKDT_NUMTAG:
902
- cPrefix = '#'; blob_append_literal(ob, "numtag"); break;
903
- }
904
- blob_append_literal(ob, "=\"");
905
- html_quote(ob, blob_buffer(text), blob_size(text));
906
- blob_append_literal(ob, "\"");
907
- blob_appendf(ob, ">%c%b</span>", cPrefix,text);
908
- }
909
- return 1;
910
-}
911
-#endif
912875
913876
static int html_triple_emphasis(
914877
struct Blob *ob,
915878
struct Blob *text,
916879
char c,
@@ -965,13 +928,10 @@
965928
html_emphasis,
966929
html_image,
967930
html_linebreak,
968931
html_link,
969932
html_raw_html_tag,
970
-#if defined(MARKDOWN_ENABLE_TAGSPAN)
971
- html_tagspan,
972
-#endif
973933
html_triple_emphasis,
974934
html_footnote_ref,
975935
976936
/* low level elements */
977937
0, /* entity */
978938
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -870,47 +870,10 @@
870 blob_appendb(ob, content);
871 }
872 blob_append(ob, zClose, -1);
873 return 1;
874 }
875 #if defined(MARKDOWN_ENABLE_TAGSPAN)
876 /* 2026-11-04: if a document has an embedded style tag and that tag
877 ** uses #rgb colors, they get parsed as hashtags. We do not yet
878 ** have a way of distinguishing that case and these produce broken
879 ** documents, so disabling #hashtags until this can be resolved. */
880 /* Invoked for @name and #tag tagged words, marked up in the
881 ** output text in a way that JS and CSS can do something
882 ** interesting with them. This isn't standard Markdown, so
883 ** it's implementation-specific what occurs here. More, each
884 ** Fossil feature using Markdown is free to apply styling and
885 ** behavior to these in feature-specific ways.
886 */
887 static int html_tagspan(
888 struct Blob *ob, /* Write the output here */
889 struct Blob *text, /* The word after the tag character */
890 enum mkd_tagspan type, /* Which type of tagspan we're creating */
891 void *opaque
892 ){
893 if( text==0 ){
894 /* no-op */
895 }else{
896 char cPrefix = '!';
897 blob_append_literal(ob, "<span data-");
898 switch (type) {
899 case MKDT_HASHTAG:
900 cPrefix = '#'; blob_append_literal(ob, "hashtag"); break;
901 case MKDT_NUMTAG:
902 cPrefix = '#'; blob_append_literal(ob, "numtag"); break;
903 }
904 blob_append_literal(ob, "=\"");
905 html_quote(ob, blob_buffer(text), blob_size(text));
906 blob_append_literal(ob, "\"");
907 blob_appendf(ob, ">%c%b</span>", cPrefix,text);
908 }
909 return 1;
910 }
911 #endif
912
913 static int html_triple_emphasis(
914 struct Blob *ob,
915 struct Blob *text,
916 char c,
@@ -965,13 +928,10 @@
965 html_emphasis,
966 html_image,
967 html_linebreak,
968 html_link,
969 html_raw_html_tag,
970 #if defined(MARKDOWN_ENABLE_TAGSPAN)
971 html_tagspan,
972 #endif
973 html_triple_emphasis,
974 html_footnote_ref,
975
976 /* low level elements */
977 0, /* entity */
978
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -870,47 +870,10 @@
870 blob_appendb(ob, content);
871 }
872 blob_append(ob, zClose, -1);
873 return 1;
874 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
875
876 static int html_triple_emphasis(
877 struct Blob *ob,
878 struct Blob *text,
879 char c,
@@ -965,13 +928,10 @@
928 html_emphasis,
929 html_image,
930 html_linebreak,
931 html_link,
932 html_raw_html_tag,
 
 
 
933 html_triple_emphasis,
934 html_footnote_ref,
935
936 /* low level elements */
937 0, /* entity */
938

Keyboard Shortcuts

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