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.
Commit
54db6de2d2a6c050d431d24ba0abe1fc2834697a6fbbf125d9415270c28c381d
Parent
5f2a69933a5ba5e…
3 files changed
+4
+8
-2
+8
-1
+4
| --- src/backlink.c | ||
| +++ src/backlink.c | ||
| @@ -283,12 +283,14 @@ | ||
| 283 | 283 | static int mkdn_noop_r_html_tag(Blob *b1, Blob *b2, void *v){ return 1; } |
| 284 | 284 | static int (*mkdn_noop_tri_emphas)(Blob*, Blob*, char, |
| 285 | 285 | void*) = mkdn_noop_emphasis; |
| 286 | 286 | static int mkdn_noop_footnoteref(Blob *b1, const Blob *b2, const Blob *b3, |
| 287 | 287 | int i1, int i2, void *v){ return 1; } |
| 288 | +#if defined(MARKDOWN_ENABLE_TAGSPAN) | |
| 288 | 289 | static int mkdn_noop_tagref(Blob *b1,Blob *b2, enum mkd_tagspan t, |
| 289 | 290 | void *p){ return 1; } |
| 291 | +#endif | |
| 290 | 292 | |
| 291 | 293 | /* |
| 292 | 294 | ** Scan markdown text and add self-hyperlinks to the BACKLINK table. |
| 293 | 295 | */ |
| 294 | 296 | void markdown_extract_links( |
| @@ -319,11 +321,13 @@ | ||
| 319 | 321 | /* emphasis */ mkdn_noop_emphasis, |
| 320 | 322 | /* image */ mkdn_noop_image, |
| 321 | 323 | /* linebreak */ mkdn_noop_linebreak, |
| 322 | 324 | /* link */ backlink_md_link, |
| 323 | 325 | /* r_html_tag */ mkdn_noop_r_html_tag, |
| 326 | +#if defined(MARKDOWN_ENABLE_TAGSPAN) | |
| 324 | 327 | /* #tags */ mkdn_noop_tagref, |
| 328 | +#endif | |
| 325 | 329 | /* tri_emphas */ mkdn_noop_tri_emphas, |
| 326 | 330 | /* footnoteref*/ mkdn_noop_footnoteref, |
| 327 | 331 | |
| 328 | 332 | 0, /* entity */ |
| 329 | 333 | 0, /* normal_text */ |
| 330 | 334 |
| --- 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 @@ | ||
| 86 | 86 | struct Blob *alt, void *opaque); |
| 87 | 87 | int (*linebreak)(struct Blob *ob, void *opaque); |
| 88 | 88 | int (*link)(struct Blob *ob, struct Blob *link, struct Blob *title, |
| 89 | 89 | struct Blob *content, void *opaque); |
| 90 | 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); | |
| 91 | +#if defined(MARKDOWN_ENABLE_TAGSPAN) | |
| 92 | + int (*tagspan)(struct Blob *ob, struct Blob *ref, enum mkd_tagspan type, | |
| 93 | + void *opaque); | |
| 94 | +#endif | |
| 93 | 95 | int (*triple_emphasis)(struct Blob *ob, struct Blob *text, |
| 94 | 96 | char c, void *opaque); |
| 95 | 97 | int (*footnote_ref)(struct Blob *ob, const struct Blob *span, |
| 96 | 98 | const struct Blob *upc, int index, int locus, void *opaque); |
| 97 | 99 | |
| @@ -959,10 +961,11 @@ | ||
| 959 | 961 | blob_append(ob, data, end); |
| 960 | 962 | } |
| 961 | 963 | return end; |
| 962 | 964 | } |
| 963 | 965 | |
| 966 | +#if defined(MARKDOWN_ENABLE_TAGSPAN) | |
| 964 | 967 | /* char_hashref_tag -- '#' followed by "word" characters to tag |
| 965 | 968 | ** post numbers, hashtags, etc. |
| 966 | 969 | ** |
| 967 | 970 | ** Basic syntax: |
| 968 | 971 | ** |
| @@ -1111,10 +1114,11 @@ | ||
| 1111 | 1114 | (int)end, (int)end, data, (int)size, data); |
| 1112 | 1115 | #endif |
| 1113 | 1116 | #undef HASHTAG_LEGAL_END |
| 1114 | 1117 | return 0; |
| 1115 | 1118 | } |
| 1119 | +#endif /* MARKDOWN_ENABLE_TAGSPAN */ | |
| 1116 | 1120 | |
| 1117 | 1121 | /* |
| 1118 | 1122 | ** char_langle_tag -- '<' when tags or autolinks are allowed. |
| 1119 | 1123 | */ |
| 1120 | 1124 | static size_t char_langle_tag( |
| @@ -2849,11 +2853,13 @@ | ||
| 2849 | 2853 | } |
| 2850 | 2854 | } |
| 2851 | 2855 | if( rndr.make.codespan ) rndr.active_char['`'] = char_codespan; |
| 2852 | 2856 | if( rndr.make.linebreak ) rndr.active_char['\n'] = char_linebreak; |
| 2853 | 2857 | if( rndr.make.image || rndr.make.link ) rndr.active_char['['] = char_link; |
| 2858 | +#if defined(MARKDOWN_ENABLE_TAGSPAN) | |
| 2854 | 2859 | rndr.active_char['#'] = char_hashref_tag; |
| 2860 | +#endif | |
| 2855 | 2861 | if( rndr.make.footnote_ref ) rndr.active_char['('] = char_footnote; |
| 2856 | 2862 | rndr.active_char['<'] = char_langle_tag; |
| 2857 | 2863 | rndr.active_char['\\'] = char_escape; |
| 2858 | 2864 | rndr.active_char['&'] = char_entity; |
| 2859 | 2865 | |
| 2860 | 2866 |
| --- 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 |
+8
-1
| --- src/markdown_html.c | ||
| +++ src/markdown_html.c | ||
| @@ -868,11 +868,15 @@ | ||
| 868 | 868 | blob_appendb(ob, content); |
| 869 | 869 | } |
| 870 | 870 | blob_append(ob, zClose, -1); |
| 871 | 871 | return 1; |
| 872 | 872 | } |
| 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. */ | |
| 874 | 878 | /* Invoked for @name and #tag tagged words, marked up in the |
| 875 | 879 | ** output text in a way that JS and CSS can do something |
| 876 | 880 | ** interesting with them. This isn't standard Markdown, so |
| 877 | 881 | ** it's implementation-specific what occurs here. More, each |
| 878 | 882 | ** Fossil feature using Markdown is free to apply styling and |
| @@ -900,10 +904,11 @@ | ||
| 900 | 904 | blob_append_literal(ob, "\""); |
| 901 | 905 | blob_appendf(ob, ">%c%b</span>", cPrefix,text); |
| 902 | 906 | } |
| 903 | 907 | return 1; |
| 904 | 908 | } |
| 909 | +#endif | |
| 905 | 910 | |
| 906 | 911 | static int html_triple_emphasis( |
| 907 | 912 | struct Blob *ob, |
| 908 | 913 | struct Blob *text, |
| 909 | 914 | char c, |
| @@ -958,11 +963,13 @@ | ||
| 958 | 963 | html_emphasis, |
| 959 | 964 | html_image, |
| 960 | 965 | html_linebreak, |
| 961 | 966 | html_link, |
| 962 | 967 | html_raw_html_tag, |
| 968 | +#if defined(MARKDOWN_ENABLE_TAGSPAN) | |
| 963 | 969 | html_tagspan, |
| 970 | +#endif | |
| 964 | 971 | html_triple_emphasis, |
| 965 | 972 | html_footnote_ref, |
| 966 | 973 | |
| 967 | 974 | /* low level elements */ |
| 968 | 975 | 0, /* entity */ |
| 969 | 976 |
| --- 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 |