theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
109 stars 8 forks source link

More over zealous route / word auto linking in markdown #2492

Open brendanheywood opened 7 years ago

brendanheywood commented 7 years ago

eg in:

image

This is linking to a route in a completely different crag. I'm not sure exactly what the current business rules are but I think this is too much. Either we don't link for single word route names, or we just make it simple and require quotes. I don't think simply blacklisting certain names will be that productive for this bug.

scd commented 7 years ago

Can we not link if a single word and at the beginning of a sentence.

We should probably hold off making changes until an language implementations has come through. I am guessing that with the use of upper case in some languages (eg German use of upper case in nouns) we will have to force quotes.

brendanheywood commented 7 years ago

Yeah my gut says the more workarounds we add the more edge cases we will create, I think just forcing quotes depending on the context (eg in discussions) is simple and understandable.

brendanheywood commented 6 years ago

Another example with a route called 'What': image

As we go more multi lingual this will get trickier, so that strengthens the forced quotes idea in certain contexts (if not all?)

brendanheywood commented 6 years ago

This one is even weirder:

This thread is in australia.

'Matt' is a route in Kalymnos: https://www.thecrag.com/climbing/greece/kalymnos/route/241111167 'Everyone' is a route in Korea: https://www.thecrag.com/climbing/south-korea/route/946916553

image

Why on earth are they linking - but also if they are linking then it must be doing a horrendously expensive scan of basically every route name in the db to find potential matches.

brendanheywood commented 6 years ago

https://www.thecrag.com/discussion/1813267536/bells-line-of-road--does-anyone-see-any-issue-with-moving-bung-crag-and-dingo-creek-to-the-wolgan-valley-section-there#m1813284507

Discussion in the blue mountains linked the word 'NEW' to a route in tasmania

https://www.thecrag.com/discussion/1813267536/bells-line-of-road--does-anyone-see-any-issue-with-moving-bung-crag-and-dingo-creek-to-the-wolgan-valley-section-there#m1813288239

and the word IF to a route in Frog

There again are outside the scope of this discussion so not sure what is going on, but there are also a bunch of other auto links to routes inside the blue mountains which probably also don't make sense either

brendanheywood commented 6 years ago

Oh wow this one is pretty bad as it has auto linked the word 'Climbing' which is a gym route:

https://www.thecrag.com/climbing/australia/queensland/brisbane/rocksports-indoor-climbing/foyer/rope7/route/1119823746

brendanheywood commented 5 years ago

Another example of an auto linked name, but from an outside forum conversation and linking into a gym route name which I think should never happen:

image

brendanheywood commented 5 years ago

From @gogulfresh via https://github.com/theCrag/website/issues/3314

What happened? A link to a route is created where it shouldn't/I don't want. How can linking be suppressed?

Example url(s) to reproduce the problem: https://www.thecrag.com/climbing/austria/route/1529281464 The word "spalt" in the description links to the route "spalt" https://www.thecrag.com/climbing/austria/route/1532385009 spalt ~= crack in german, thus in the text it is refering to a crack of this route and not the route "spalt"

image

What you expected:

rouletout commented 5 years ago
gogulfresh commented 5 years ago

Another one: https://www.thecrag.com/climbing/austria/route/1880663691

bildschirmfoto 2018-11-23 um 15 58 38

Verschneidung == book/corner/dihedral (What is the correct translation?)

rouletout commented 5 years ago

Another one:

https://www.thecrag.com/discussion/2203101762/kletterwerk--neue-boulderrouten

screen shot 2019-01-16 at 10 13 19
rouletout commented 5 years ago

Another one:

https://www.thecrag.com/discussion/2254853829

screen shot 2019-02-13 at 10 09 57
rouletout commented 5 years ago

Another one:

https://www.thecrag.com/discussion/2304627114/australia--mountainfilm-on-tour

Screen Shot 2019-03-13 at 08 32 33
brendanheywood commented 5 years ago

Ugghh so many duds in a single thread, and picked up randomly from crags all over the world:

I got the grumps with this and dug around a little, and it turns out we always went up a node and then searched inside that, so if the discussion was at the australia level then we searched the entire world looking for matches. I've refined this a little, so it only searchs the TLC, or "this" node, or a routes parent cliff and added an explicit exclusion for the world. I think this is about 60% of the solution. I still think even within a crag there are too may false matches but at least they are not now from random crags around the world.

brendanheywood commented 5 years ago

image

https://www.thecrag.com/climbing/australia/blue-mountains/mount-piddington/route/15380833

georg-d commented 3 years ago

From @gogulfresh via #3314 ...

Please do not add the details there, but add only a link to the (still to be done) description in https://www.thecrag.com/en/article/formattingtext#internal-links because the links do work in many other text fields than route descriptions.

rouletout commented 3 years ago

Thanks for all the comments. This "feature" has become more of a pain than anything else and we are considering to remove it completely. the idea is to require hyphens or simialr to create the link but remove all links that are strictly text based as in the examples above.

If you have any commenst on this, please put them here.