agora-server
agora-server copied to clipboard
Heading anchoring
As of https://anagora.org/flancia-meet-2022-01-29, we agreed that we need common anchoring rules.
Let's define them here
Mycomarkup does it like that: https://github.com/bouncepaw/mycomarkup/blob/742e8e254ff82f0f51ee8ee0b27daf25245dc96d/util/utils.go#L10
example from MediaWiki https://www.mediawiki.org/wiki/Help:Links#Internal_links
[[Help:Editing pages#Preview|previewing]]
My logic on this (and most things) is let's not get caught by [[not invented here]] syndrome
If existing paradigms exists, it seems somewhat hostile to not reuse them
It looks like DokuWiki uses same syntax https://forum.dokuwiki.org/d/38-internal-links-syntax/4
Seems like MediaWiki simply replaces whitespace with _ and uses it as an id for headings, it even saves punctuation marks.
So, a heading with the text Special:Not so special
would render with id Special:Not_so_special
.
That makes sense.
I propose dropping all octothorps from the heading as well. Issue #1
-> Issue_1
. Some bugs related to URL parsing will be avoided this way.
What do we do with markup in headings? I guess we only take their content. So, a Mycomarkup like this:
= A heading with a [[link]]
Would result with a heading with this id: A heading with a link
.