Git Merge Request #326: Added md extension to detect user mentions (merged)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Shalitha Suranga wants to merge 2 commits from /u/shalithasuranga/allura/ to master, 2019-05-16

Fixes [#8281]

Commit Date  
[c7fc77] (gsoc19-c1) by Shalitha Suranga Shalitha Suranga

[#8281] Improved um markdown extension and its tests

2019-05-15 17:04:36 Tree
[d94016] by Shalitha Suranga Shalitha Suranga

[#8281] Added an makrdown extension for detecting user mentions

2019-05-12 11:47:24 Tree

Discussion

  • Dave Brondsema

    Dave Brondsema - 2019-05-14

    A user may be disabled or pending, in which case we shouldn't link to the user's url

    If a user isn't found, I don't think having a link to # is very helpful, maybe better to just leave it as plain text?

    Might be good to have the test check slightly more complex text like hi @admin1, are you there

    I also remembered that allura may cache the results of markdown rendering, so just keep that in mind. When all the user mention work is done, we can invalidate all the caches so html output is generated (via the bugfix_rev variable in cached_convert). There may also be minor inconsistencies if users are created or removed over time but the cached output doesn't update its links (similar to wiki pages links in [#8236]) but that should be relatively rare and seems like a very hard problem to solve. But when you get to data like full names within the hover info card we'll want to make sure that is not part of the markdown output so that it isn't cached, but instead is added via JS more dynamically.

     
    👍
    1

    Related

    Tickets: #8236

    • Hi.. Dave

      Thanks for the feedback. Yeah I noticed the caching in markdown conversion
      Do you mean we can do like this with the user's status vs mention link as per below?

      if user is not found --> plain text eg @abcd1
      if user is found but !disabled and !pending --> clickable link
      if user is found but disabled or pending --> link with red color?

       
      • Dave Brondsema

        Dave Brondsema - 2019-05-14

        disabled or pending should be treated the same as not found. And then I'd be ok with those being either plain text (simplest) or a red link if you want to show that a user doesn't exist with that username.

         
  • Yeah agree. Since red link is usually having an anchor tag, I aslo think we can go with plain text for now. I will update with required modifications.

     
  • Hi.. Dave

    I have improved the tests and also changed the extension logic

     

    Last edit: Shalitha Suranga 2019-05-15
  • Dave Brondsema

    Dave Brondsema - 2019-05-16
    • Status: open --> merged
     

Log in to post a comment.