athensresearch / athens

Athens is no longer maintainted. Athens was an open-source, collaborative knowledge graph, backed by YC W21
https://athensresearch.github.io/athens
Other
6.31k stars 397 forks source link

Page ref not parsed as such if immediately followed by alphanumeric character #1243

Open dudelson opened 3 years ago

dudelson commented 3 years ago

Problem

If a page ref is immediately followed by an alphanumeric character after the closing double brackets, it is not parsed as a page ref, and is thus not clickable.

Screenshots/Demo

athens-page-ref-parse-bug

Athens Version

1.0.0-beta.82

dudelson commented 3 years ago

Originally I thought that this bug occurred when a page ref was followed by any non-whitespace character, but I noticed just now that it actually appears to be only alphanumeric characters. I've updated the issue title and initial comment accordingly.

sid597 commented 3 years ago

@tangjeff0 @neotyk Is this a bug or a feature? Either way, we have to make it consistent. Currently one can prepend a page ref with character/word but it is not possible to append a word or to have a page ref be surrounded by word. We either have to allow all 3 cases or disallow them, if allow all the cases then it would inconsistent with hashtags where we disallow all the cases.

tangjeff0 commented 3 years ago

Certainly a bug @neotyk

sid597 commented 3 years ago

I looked into this issue and found that this issue can be reproduced for many structures which are parsed inline. For e.g all of the following structures can have a character/word prepended to them but cannot append :

This is because I think the inline parser has some bugs is inconsistent:

So, to solve this issue I think we have to correct text-run's grammar and update the grammar of structures for whom it is acceptable to be surrounded by words/characters as we do for block-ref.

Please correct me if I mistake somewhere @neotyk @tangjeff0