Fossil Forum
Post: RFC: "hashtag" support in the markdown parser
Good morning, all,
The markdown-tagrefs branch has been sitting around idle for about 2 years and it's now time to decide whether this is something worth merging or if it should be discarded.
Background: the problem to be solved is recognizing hashtag-like references in Markdown and wrapping them in a SPAN element so that JS code can find them (using CSS selectors) and attach behavior to them. The initial use cases are message references in /chat (we frequently reference messaged by their ID, e.g. "re. #12345: ...") and forum posts, where a comment like "re. #3" might jump to message #3 in the thread. Recognizing @username references was an initial goal, the intent being to force /chat to beep when one is mentioned by name, but that was dropped due to reliability/ambiguity concerns in the parsing re. email addresses (fossil user names may be email addresses).
A fuller description and example inputs and outputs can be found in the branch's wiki page (see previous link).
Currently only /chat does anything with this info - for all other cases it emits a small amount of innocuous HTML to wrap hashtag-like entities but it does not affect the rendering. In /chat tapping #12345 in a message will, if that referenced message is locally loaded, jump to that message or, if it's not yet loaded, run a search for that message, making it easy to read both it and the surrounding context (perhaps many months old).
We've been running this branch for several days in the libfossil /chat and its message-number recognition has proven to be useful there.
Unless there are objections i'd like to merge this soon-ish, but also won't be heartbroken if the collective decision is to discard it.
What says the forum?
Good morning, all,
The markdown-tagrefs branch has been sitting around idle for about 2 years and it's now time to decide whether this is something worth merging or if it should be discarded.
Background: the problem to be solved is recognizing hashtag-like references in Markdown and wrapping them in a SPAN element so that JS code can find them (using CSS selectors) and attach behavior to them. The initial use cases are message references in /chat (we frequently reference messaged by their ID, e.g. "re. #12345: ...") and forum posts, where a comment like "re. #3" might jump to message #3 in the thread. Recognizing @username references was an initial goal, the intent being to force /chat to beep when one is mentioned by name, but that was dropped due to reliability/ambiguity concerns in the parsing re. email addresses (fossil user names may be email addresses).
A fuller description and example inputs and outputs can be found in the branch's wiki page (see previous link).
Currently only /chat does anything with this info - for all other cases it emits a small amount of innocuous HTML to wrap hashtag-like entities but it does not affect the rendering. In /chat tapping #12345 in a message will, if that referenced message is locally loaded, jump to that message or, if it's not yet loaded, run a search for that message, making it easy to read both it and the surrounding context (perhaps many months old).
We've been running this branch for several days in the libfossil /chat and its message-number recognition has proven to be useful there.
Unless there are objections i'd like to merge this soon-ish, but also won't be heartbroken if the collective decision is to discard it.
What says the forum?
This seems like a fine example of a case where chasing “perfect” means never delivering. If it’s useful, it will attract refinement, but who can tell whether code that never runs is useful? Z 2bc
This seems like a fine example of a case where chasing “perfect” means never delivering.
Precisely. IMO it's working well for its use case, isn't terribly much (or complex) code, but i'm also admittedly struggling to find genuine uses for it beyond the current /chat features and as-yet-hypothetical intra-thread links in /forumpost. Z e
The thing about semantic markup is, it should be done without knowing even one of ultimate use cases. These features get used quietly, all over the place, and those running the site providing them often never even learn that those features are in active use.
More than once I've found use for such features in site scraping, where no better UI was available, because the markup gave me enough of a handle I could construct a reliable DOM query for it, saving me from regex bashing.
I'm too lazy to look at that branch, but what's the question? How to use that anywhere outside of chat? Well, in some current social networks or messenger it's established convention that clicking on #hashtag opens a search on that hashtag. That is, user could go (in not all of that socials, but still) to search page and type a search term manually, but this just saves time. It's not that I'm suggesting to re-do meaning (or it can be different on different pages, like msg number in chat but search term in forum), but it's better to have markup than not. So better merge than not!
Having never used that branch I guess I don't know what I'm missing, but if it's useful to some it may prove useful to others once merged.
What says the forum?
Based on the feedback so far: please consider this to be "last call" that the markdown-tagrefs branch will be merged soon-ish (in the next few days) unless objections are voiced.
I'd shorten it to "tomorrow".