Fossil

Timeline
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

About branch markdown-tagrefs

The purpose of the markdown-refs branch is to experiment with adding hashtag and @username support into the markdown parser.

In short, it attempts to recognize hashtags and wrap those tokens in SPAN elements with well-defined attributes so that they can be identified by downstream JavaScript code and context-specific features applied to them:

  • #Hashtag ==> <span data-hashtag="Hashtag">#Hashtag</span>
  • #nnnnn (numeric) ==> <span data-numtag="nnnnn">#nnnnn</span>
  • @name ==> <span data-atref="name">@name</span> Removed because it is flaky and is awkward with email-style user names. The last version with this (partial) support was 9d3ca32ef7ad570d5b.

This markup has no outwardly-visible effect unless CSS and/or JS code are apply style resp. features to the elements. The most obvious use for hashtags would be to apply them as filters in the forum and chat. For example, clicking on a hashtag in the forum or chat could filter on messages which have that tag. (Note that containing the hashtag and "having that tag" are separate things: opaque text vs. a fossil tag artifact.) One issue we'd have for that use case, though, is that fossil tags are case-sensitive and hashtags are notoriously inconsistent in their casing, so any interface for adding tags for this purpose would need to lowercase them for consistency.

The core hashtag parsing seems to work well, including support for non-ASCII hashtags, and a demo of its use is integrated into the /chat page:

  1. Tapping a #nnnnn numeric hashtag will scroll to the given message if it's been loaded, otherwise it will search the chat history for that message. It's common to reference other messages that way in chat, and this branch now makes it easier to refer back to such references.
  2. Tapping a hashtag will filter only on messages containing that hashtag, noting that this is limited to locally-loaded messages and does not search the chat history (adding hashtag support to that would require a custom tokenizer to handle the # characters).

Potential uses for these tags include:

  • Filtering /chat and /forum posts by hashtags or, in the case of /chat, message IDs. For the forum, this would require UI infrastructure for providing a way to tag posts. For /chat messages which are already loaded into the current session, searching for matching entries can be done client-side.
  • In the forum, constructs like "in response to #29" could link to the most recent post #29 (possibly 29.x) if it's loaded in the current page.

The functional code for all such links can be injected via Javascript. The C level simply has to provide the HTML markup. Searching the DOM for such entries requires only a call to, e.g., document.querySelectorAll('span[data-hashtag]').

Example input to feed to the test-markdown-render command:

___#tag___
hashtag: #1_2
numtag: #123.4
numtag: #1
numtag 2.3: #2.3.4 (note that only 2.3 gets wrapped)
xyz
#_notAHashtag_
hashtag: #tag_ok
#tag__not: not a hashtag because of multiple underscores
#tagNOT#NotATag
hashtag w/ em: *#ValidTag*
hashtag: #äValidTÄg
not tagged: `#InBackticks`

# header with #123 tag

# header with #hashtag

63 check-ins related to "markdown-tagrefs"
2024-07-06
09:33
/chat: when tapping on a #NNNN reference, if the referred-to message is not loaded in the local history then search the chat history for message #NNNN. ... (Leaf check-in: 347084af90 user: stephan tags: markdown-tagrefs)
2024-07-03
12:55
Merge trunk into the markdown-tagrefs branch to begin experimentation with tying chat #NNN references into the new search capabilities. ... (check-in: 5e26fd4c10 user: stephan tags: markdown-tagrefs)
12:38
Add /chat history search. ... (check-in: fc853823b2 user: stephan tags: trunk)
09:35
Remove the incomplete @tag support. Add some sample inputs to the [/wiki?name=branch/markdown-tagrefs|branch/markdown-tagrefs] page. ... (check-in: 4d7c408f52 user: stephan tags: markdown-tagrefs)
09:16
Merge trunk into markdown-tagrefs branch. ... (check-in: 9d3ca32ef7 user: stephan tags: markdown-tagrefs)
2024-07-02
08:19
For the previous check-in, disable the submit button rather than use alert(). ... (check-in: fe24713a27 user: danield tags: trunk)
2024-03-05
12:53
Merge trunk into markdown-tagrefs branch. ... (check-in: 0517bd2dd8 user: stephan tags: markdown-tagrefs)
08:44
Part 2 of 2 of [91a73ec348d7609f]: add --dark-pikchr to the test-wiki-render and test-markdown-render commands. ... (check-in: aac2a35086 user: stephan tags: trunk)
2023-06-03
08:59
Merge trunk into markdown-tagrefs branch and resolve conflict. ... (check-in: fdd3fe21c2 user: stephan tags: markdown-tagrefs)
2023-06-01
18:02
Admin users have a link in /forumthread to show the hash of all artifacts associated with that thread. ... (check-in: 83928d8a02 user: drh tags: trunk)
2023-01-21
12:14
Merge trunk into markdown-tagrefs branch. ... (check-in: baf038b1aa user: stephan tags: markdown-tagrefs)
11:40
Make diff --checkin VERSION capable for working from outside of a checkout. ... (check-in: 8e8e0269a9 user: stephan tags: trunk)
2022-09-26
08:11
Merge trunk into markdown-tagrefs branch. ... (check-in: 7321b44acf user: stephan tags: markdown-tagrefs)
07:08
Cherrypick [5ade6fb863e4], inadvertently checked in on a different branch. ... (check-in: 44c5d02932 user: stephan tags: trunk)
06:47
Correct an outdated path and fix a typo reported in the forum. Doc changes only, no code. ... (check-in: 5ade6fb863 user: stephan tags: markdown-tagrefs)
2022-09-15
17:48
Merge trunk into markdown-tagrefs branch. ... (check-in: 8ef0347fd3 user: stephan tags: markdown-tagrefs)
17:11
Add documentation for chat-timeline-user. ... (check-in: 24c71dfb1e user: drh tags: trunk)
2022-06-18
07:04
Merged in trunk. ... (check-in: 4d62992991 user: stephan tags: markdown-tagrefs)
2022-06-17
11:04
Made a cryptic 'not found' error message when failing to resolve a symbolic name slightly less cryptic in response to confusion reported in [forum:1eaa68bb75 | forum post 1eaa68bb75]. ... (check-in: 30f669b004 user: stephan tags: trunk)
2022-06-11
12:34
Merged in trunk. ... (check-in: fd14e7ec62 user: stephan tags: markdown-tagrefs)
08:32
Typo fix report in [forum:099e10c762b43add]. ... (check-in: b942cd2155 user: stephan tags: trunk)
2022-04-24
22:46
Merged in trunk, resolved conflicts introduced via the parallel development of the markdown-footnotes branch. ... (check-in: 64af75b070 user: stephan tags: markdown-tagrefs)
22:31
Applied trivial repolist sorting patch from [forum:/forumpost/6803efde75 | forum post 6803efde75]. ... (check-in: 61974c4830 user: stephan tags: trunk)
2022-04-08
08:46
Merged in trunk. ... (check-in: e8a1382fc3 user: stephan tags: markdown-tagrefs)
08:45
Cherrypicked [2f3c84b3e9ed], which wash intended for trunk. ... (check-in: 834db57d95 user: stephan tags: trunk)
2022-04-07
15:37
s/Safara/Safari/, per report from [forum:9e8015e09c | forum post 9e8015e09c]. ... (check-in: 2f3c84b3e9 user: stephan tags: markdown-tagrefs)
2022-03-30
14:15
Merged in trunk. ... (check-in: 28fa015357 user: stephan tags: markdown-tagrefs)
2022-03-28
13:39
Bug fix to the abs() function of pikchr. ... (check-in: b80ae0215e user: drh tags: trunk)
2022-01-15
13:58
Cherrypicked [5fd1ca6f] (was checked in to wrong branch). ... (check-in: 8d456a5b77 user: stephan tags: trunk)
13:54
In standalone TLS mode, SSL_read() must be performed in a loop to avoid truncated POST data. Discussed in [https://sqlite.org/althttpd/forumpost/11c263b822fde80d | althttpd forum post 11c263b822fde80d]. ... (check-in: 5fd1ca6fba user: stephan tags: markdown-tagrefs)
10:09
Merged in trunk. ... (check-in: d11cbb637b user: stephan tags: markdown-tagrefs)
07:15
fix formatting style as per https://fossil-scm.org/forum/forumpost/a711fb4fa0 ... (check-in: 9769c4f756 user: rdb tags: trunk)
2021-12-31
02:59
Merged in trunk. ... (check-in: c800d2ca82 user: stephan tags: markdown-tagrefs)
2021-12-30
19:25
Updated change log for new /chat embedding feature. ... (check-in: 79ebb3c18a user: stephan tags: trunk)
2021-12-16
04:20
Merged in trunk and resolved numerous code clashes in /chat. ... (check-in: 54dba74790 user: stephan tags: markdown-tagrefs)
2021-12-14
14:49
Added help text doc for -k alias for --keep for the open command, per [forum:6f17cf142f80e2c3 | forum post 6f17cf142f80e2c3]. ... (check-in: 8fee91d408 user: stephan tags: trunk)
2021-10-06
02:38
Merge in trunk for test server deployment. ... (check-in: 664b04b280 user: stephan tags: markdown-tagrefs)
02:37
/chat: a potential fix to stop *some* builds of Firefox from pasting formatted content into the edit field. (Some builds, same version, do not do so.) ... (check-in: 498bc071ca user: stephan tags: trunk)
2021-10-05
18:44
Merged in trunk for latest /chat features. ... (check-in: 49689e1c70 user: stephan tags: markdown-tagrefs)
18:43
/chat: re-added accidentally-disabled animation. Added a button to locally delete all messages prior to the current one in the per-message controls. The intent is to stop unbounded growth (and potential lag) in long-running chats and give the user to way to flag "have read up until this point". ... (check-in: fe0bcfaad1 user: stephan tags: trunk)
17:31
Any non-ASCII characters are now considered valid for use in hashtags. ... (check-in: 4f68a1306f user: stephan tags: markdown-tagrefs)
2021-10-04
19:48
Merged in trunk for latest (and conflicting) /chat changes. ... (check-in: 7cae4c0981 user: stephan tags: markdown-tagrefs)
19:33
/chat: reduced the size of the non-compact-mode buttons a bit, based on user feedback. We'll call this solved for now. ... (check-in: 1fc2a26577 user: stephan tags: trunk)
2021-09-29
16:50
Merged in trunk for latest changes. ... (check-in: 09f86815c6 user: stephan tags: markdown-tagrefs)
16:45
Consolidated /wikiedit, /pikchrshow, /fileedit, and /chat to use shift-enter to run preview mode. The former 3 previously used ctrl-enter but it was poorly documented and probably not widely used like ctrl-enter is in chat (to send a message). ... (check-in: 13fabf3f4d user: stephan tags: trunk)
2021-09-28
11:22
/chat: experimental HTML5 history support for using the back button to return to a message from which a #nnn message ID was clicked. ... (check-in: 9df3fc6b0f user: stephan tags: markdown-tagrefs)
11:06
Merged in trunk. /chat changed jump-to-message animation to fade out/in, per requests. Added HTML5 history to /chat clicks on #NNN message references but it's disabled because it's behaving unexpectedly. ... (check-in: 99b23d0fa3 user: stephan tags: markdown-tagrefs)
09:45
Moved chat.js to fossil.page.chat.js, for consistency with the other single-page apps and to emphasize that it is not to be loaded on arbitrary pages. Changed chat's startup to wait until the page on-load event to avoid a related timing issue. ... (check-in: 3ec8c6c04d user: stephan tags: trunk)
2021-09-25
12:26
Added #NNN and #NNN.NNN references as a special case of hashtag, noting that it will currently match a prefix of #NNN.NNN.NNN. Taught /chat that clicking on such a reference should jump to the referenced message or toast the user that the message is not in the current history. ... (check-in: 4539bf8792 user: stephan tags: markdown-tagrefs)
11:35
/chat: when applying a filter, automatically switch to the messages view. Apply hashtag processing to the preview view. ... (check-in: b59a761bb2 user: stephan tags: markdown-tagrefs)
10:54
Improved the behavior in the face of multiple filters, applying only the most recent one. Added a button to clear filters which appears along the bottom of the message area if any filter is active. ... (check-in: 93bf25055a user: stephan tags: markdown-tagrefs)
08:17
More progress on the markdown #hashtag parsing. ... (check-in: ac5b66bb40 user: stephan tags: markdown-tagrefs)
07:20
Merged in latest trunk. test-markdown-render now accepts files and string literals. ... (check-in: 5618cceb7b user: stephan tags: markdown-tagrefs)
07:00
Added missing new mkd_renderer entry in markdown_extract_links() to skip over @/#tags. ... (check-in: 2e64642841 user: stephan tags: markdown-tagrefs)
2021-09-24
17:18
Added an optional widget to /chat which gives an overview of who is actively posting and enables filtering messages by users. ... (check-in: ce0d61bbae user: stephan tags: trunk)
2021-09-21
17:36
Removed a bogus unreached return statement. ... (check-in: 4b98f9e791 user: stephan tags: markdown-tagrefs)
17:34
More refinement of the token selection for #hashtag and @name references. ... (check-in: 3363ab42c0 user: stephan tags: markdown-tagrefs)
16:42
Fixed a paren nesting bug that prevented multi-character hashtags from being processed. It would stop at the second character. ... (check-in: e211f1ab42 user: wyoung tags: markdown-tagrefs)
16:38
Added '@' and '#' prefixes in spans. Initial commit ate them. ... (check-in: 398cfa0be0 user: wyoung tags: markdown-tagrefs)
16:29
Merged in parallel trunk changes. ... (check-in: 9b07f400ce user: stephan tags: markdown-tagrefs)
16:28
Removed some extraneous console debug output. ... (check-in: 8663dde1df user: stephan tags: trunk)
16:19
Initial implementation of "span data-foo" wrappers around @name and #tag references. Seems functional on a test-markdown-render basis, but the definitions of what counts as a reference and what to do with them still remains to be handled. ... (check-in: 31a607d33c user: wyoung tags: markdown-tagrefs)
15:02
Updated changelog for chat preview. Hyperlinks in preview mode now have target=_blank. Removed extraneous FORM element around chat input area, as it caused only grief with regards to Enter key handling (always activating the first button in the list, which is now the preview button). ... (check-in: 60ed1ff951 user: stephan tags: trunk)