Fossil SCM

Disable the markdown hashtag support because it interferes with client docs which contain, e.g., STYLE tags with #rgb color values in them. Whether that's resolvable within the converter's view of the world is as yet unclear.

stephan 2026-11-04 11:14 UTC trunk
Commit 54db6de2d2a6c050d431d24ba0abe1fc2834697a6fbbf125d9415270c28c381d
--- src/backlink.c
+++ src/backlink.c
@@ -283,12 +283,14 @@
283283
static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; }
284284
static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char,
285285
void*) = mkdn_noop_emphasis;
286286
static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3,
287287
int i1, int i2, void *v){ return 1; }
288
+#if defined(MARKDOWN_ENABLE_TAGSPAN)
288289
static int mkdn_noop_tagref(Blob *b1,Blob *b2, enum mkd_tagspan t,
289290
void *p){ return 1; }
291
+#endif
290292
291293
/*
292294
** Scan markdown text and add self-hyperlinks to the BACKLINK table.
293295
*/
294296
void markdown_extract_links(
@@ -319,11 +321,13 @@
319321
/* emphasis */ mkdn_noop_emphasis,
320322
/* image */ mkdn_noop_image,
321323
/* linebreak */ mkdn_noop_linebreak,
322324
/* link */ backlink_md_link,
323325
/* r_html_tag */ mkdn_noop_r_html_tag,
326
+#if defined(MARKDOWN_ENABLE_TAGSPAN)
324327
/* #tags */ mkdn_noop_tagref,
328
+#endif
325329
/* tri_emphas */ mkdn_noop_tri_emphas,
326330
/* footnoteref*/ mkdn_noop_footnoteref,
327331
328332
0, /* entity */
329333
0, /* normal_text */
330334
--- src/backlink.c
+++ src/backlink.c
@@ -283,12 +283,14 @@
283 static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; }
284 static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char,
285 void*) = mkdn_noop_emphasis;
286 static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3,
287 int i1, int i2, void *v){ return 1; }
 
288 static int mkdn_noop_tagref(Blob *b1,Blob *b2, enum mkd_tagspan t,
289 void *p){ return 1; }
 
290
291 /*
292 ** Scan markdown text and add self-hyperlinks to the BACKLINK table.
293 */
294 void markdown_extract_links(
@@ -319,11 +321,13 @@
319 /* emphasis */ mkdn_noop_emphasis,
320 /* image */ mkdn_noop_image,
321 /* linebreak */ mkdn_noop_linebreak,
322 /* link */ backlink_md_link,
323 /* r_html_tag */ mkdn_noop_r_html_tag,
 
324 /* #tags */ mkdn_noop_tagref,
 
325 /* tri_emphas */ mkdn_noop_tri_emphas,
326 /* footnoteref*/ mkdn_noop_footnoteref,
327
328 0, /* entity */
329 0, /* normal_text */
330
--- src/backlink.c
+++ src/backlink.c
@@ -283,12 +283,14 @@
283 static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; }
284 static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char,
285 void*) = mkdn_noop_emphasis;
286 static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3,
287 int i1, int i2, void *v){ return 1; }
288 #if defined(MARKDOWN_ENABLE_TAGSPAN)
289 static int mkdn_noop_tagref(Blob *b1,Blob *b2, enum mkd_tagspan t,
290 void *p){ return 1; }
291 #endif
292
293 /*
294 ** Scan markdown text and add self-hyperlinks to the BACKLINK table.
295 */
296 void markdown_extract_links(
@@ -319,11 +321,13 @@
321 /* emphasis */ mkdn_noop_emphasis,
322 /* image */ mkdn_noop_image,
323 /* linebreak */ mkdn_noop_linebreak,
324 /* link */ backlink_md_link,
325 /* r_html_tag */ mkdn_noop_r_html_tag,
326 #if defined(MARKDOWN_ENABLE_TAGSPAN)
327 /* #tags */ mkdn_noop_tagref,
328 #endif
329 /* tri_emphas */ mkdn_noop_tri_emphas,
330 /* footnoteref*/ mkdn_noop_footnoteref,
331
332 0, /* entity */
333 0, /* normal_text */
334
+8 -2
--- src/markdown.c
+++ src/markdown.c
@@ -86,12 +86,14 @@
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
- int (*tagspan)(struct Blob *ob, struct Blob *ref, enum mkd_tagspan type,
92
- 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
9395
int (*triple_emphasis)(struct Blob *ob, struct Blob *text,
9496
char c, void *opaque);
9597
int (*footnote_ref)(struct Blob *ob, const struct Blob *span,
9698
const struct Blob *upc, int index, int locus, void *opaque);
9799
@@ -959,10 +961,11 @@
959961
blob_append(ob, data, end);
960962
}
961963
return end;
962964
}
963965
966
+#if defined(MARKDOWN_ENABLE_TAGSPAN)
964967
/* char_hashref_tag -- '#' followed by "word" characters to tag
965968
** post numbers, hashtags, etc.
966969
**
967970
** Basic syntax:
968971
**
@@ -1111,10 +1114,11 @@
11111114
(int)end, (int)end, data, (int)size, data);
11121115
#endif
11131116
#undef HASHTAG_LEGAL_END
11141117
return 0;
11151118
}
1119
+#endif /* MARKDOWN_ENABLE_TAGSPAN */
11161120
11171121
/*
11181122
** char_langle_tag -- '<' when tags or autolinks are allowed.
11191123
*/
11201124
static size_t char_langle_tag(
@@ -2849,11 +2853,13 @@
28492853
}
28502854
}
28512855
if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan;
28522856
if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak;
28532857
if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link;
2858
+#if defined(MARKDOWN_ENABLE_TAGSPAN)
28542859
rndr.active_char['#'] = char_hashref_tag;
2860
+#endif
28552861
if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote;
28562862
rndr.active_char['<'] = char_langle_tag;
28572863
rndr.active_char['\\'] = char_escape;
28582864
rndr.active_char['&'] = char_entity;
28592865
28602866
--- src/markdown.c
+++ src/markdown.c
@@ -86,12 +86,14 @@
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 (*tagspan)(struct Blob *ob, struct Blob *ref, enum mkd_tagspan type,
92 void *opaque);
 
 
93 int (*triple_emphasis)(struct Blob *ob, struct Blob *text,
94 char c, void *opaque);
95 int (*footnote_ref)(struct Blob *ob, const struct Blob *span,
96 const struct Blob *upc, int index, int locus, void *opaque);
97
@@ -959,10 +961,11 @@
959 blob_append(ob, data, end);
960 }
961 return end;
962 }
963
 
964 /* char_hashref_tag -- '#' followed by "word" characters to tag
965 ** post numbers, hashtags, etc.
966 **
967 ** Basic syntax:
968 **
@@ -1111,10 +1114,11 @@
1111 (int)end, (int)end, data, (int)size, data);
1112 #endif
1113 #undef HASHTAG_LEGAL_END
1114 return 0;
1115 }
 
1116
1117 /*
1118 ** char_langle_tag -- '<' when tags or autolinks are allowed.
1119 */
1120 static size_t char_langle_tag(
@@ -2849,11 +2853,13 @@
2849 }
2850 }
2851 if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan;
2852 if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak;
2853 if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link;
 
2854 rndr.active_char['#'] = char_hashref_tag;
 
2855 if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote;
2856 rndr.active_char['<'] = char_langle_tag;
2857 rndr.active_char['\\'] = char_escape;
2858 rndr.active_char['&'] = char_entity;
2859
2860
--- src/markdown.c
+++ src/markdown.c
@@ -86,12 +86,14 @@
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
@@ -959,10 +961,11 @@
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 **
@@ -1111,10 +1114,11 @@
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(
@@ -2849,11 +2853,13 @@
2853 }
2854 }
2855 if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan;
2856 if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak;
2857 if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link;
2858 #if defined(MARKDOWN_ENABLE_TAGSPAN)
2859 rndr.active_char['#'] = char_hashref_tag;
2860 #endif
2861 if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote;
2862 rndr.active_char['<'] = char_langle_tag;
2863 rndr.active_char['\\'] = char_escape;
2864 rndr.active_char['&'] = char_entity;
2865
2866
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -868,11 +868,15 @@
868868
blob_appendb(ob, content);
869869
}
870870
blob_append(ob, zClose, -1);
871871
return 1;
872872
}
873
-
873
+#if defined(MARKDOWN_ENABLE_TAGSPAN)
874
+/* 2026-11-04: if a document has an embedded style tag and that tag
875
+** uses #rgb colors, they get parsed as hashtags. We do not yet
876
+** have a way of distinguishing that case and these produce broken
877
+** documents, so disabling #hashtags until this can be resolved. */
874878
/* Invoked for @name and #tag tagged words, marked up in the
875879
** output text in a way that JS and CSS can do something
876880
** interesting with them. This isn't standard Markdown, so
877881
** it's implementation-specific what occurs here. More, each
878882
** Fossil feature using Markdown is free to apply styling and
@@ -900,10 +904,11 @@
900904
blob_append_literal(ob, "\"");
901905
blob_appendf(ob, ">%c%b</span>", cPrefix,text);
902906
}
903907
return 1;
904908
}
909
+#endif
905910
906911
static int html_triple_emphasis(
907912
struct Blob *ob,
908913
struct Blob *text,
909914
char c,
@@ -958,11 +963,13 @@
958963
html_emphasis,
959964
html_image,
960965
html_linebreak,
961966
html_link,
962967
html_raw_html_tag,
968
+#if defined(MARKDOWN_ENABLE_TAGSPAN)
963969
html_tagspan,
970
+#endif
964971
html_triple_emphasis,
965972
html_footnote_ref,
966973
967974
/* low level elements */
968975
0, /* entity */
969976
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -868,11 +868,15 @@
868 blob_appendb(ob, content);
869 }
870 blob_append(ob, zClose, -1);
871 return 1;
872 }
873
 
 
 
 
874 /* Invoked for @name and #tag tagged words, marked up in the
875 ** output text in a way that JS and CSS can do something
876 ** interesting with them. This isn't standard Markdown, so
877 ** it's implementation-specific what occurs here. More, each
878 ** Fossil feature using Markdown is free to apply styling and
@@ -900,10 +904,11 @@
900 blob_append_literal(ob, "\"");
901 blob_appendf(ob, ">%c%b</span>", cPrefix,text);
902 }
903 return 1;
904 }
 
905
906 static int html_triple_emphasis(
907 struct Blob *ob,
908 struct Blob *text,
909 char c,
@@ -958,11 +963,13 @@
958 html_emphasis,
959 html_image,
960 html_linebreak,
961 html_link,
962 html_raw_html_tag,
 
963 html_tagspan,
 
964 html_triple_emphasis,
965 html_footnote_ref,
966
967 /* low level elements */
968 0, /* entity */
969
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -868,11 +868,15 @@
868 blob_appendb(ob, content);
869 }
870 blob_append(ob, zClose, -1);
871 return 1;
872 }
873 #if defined(MARKDOWN_ENABLE_TAGSPAN)
874 /* 2026-11-04: if a document has an embedded style tag and that tag
875 ** uses #rgb colors, they get parsed as hashtags. We do not yet
876 ** have a way of distinguishing that case and these produce broken
877 ** documents, so disabling #hashtags until this can be resolved. */
878 /* Invoked for @name and #tag tagged words, marked up in the
879 ** output text in a way that JS and CSS can do something
880 ** interesting with them. This isn't standard Markdown, so
881 ** it's implementation-specific what occurs here. More, each
882 ** Fossil feature using Markdown is free to apply styling and
@@ -900,10 +904,11 @@
904 blob_append_literal(ob, "\"");
905 blob_appendf(ob, ">%c%b</span>", cPrefix,text);
906 }
907 return 1;
908 }
909 #endif
910
911 static int html_triple_emphasis(
912 struct Blob *ob,
913 struct Blob *text,
914 char c,
@@ -958,11 +963,13 @@
963 html_emphasis,
964 html_image,
965 html_linebreak,
966 html_link,
967 html_raw_html_tag,
968 #if defined(MARKDOWN_ENABLE_TAGSPAN)
969 html_tagspan,
970 #endif
971 html_triple_emphasis,
972 html_footnote_ref,
973
974 /* low level elements */
975 0, /* entity */
976

Keyboard Shortcuts

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