URL with brackets ( ) not fully hyperlinked

ConversazioniBug Collectors

Iscriviti a LibraryThing per pubblicare un messaggio.

URL with brackets ( ) not fully hyperlinked

1mr.philistine
Apr 17, 2022, 3:07 pm

Greetings!
LT does not fully hyperlink this URL: https://en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)
As you can see above, "(musical)" is not linked.

However hyperlinking a text or image with the same URL works fine:

This way to the LOTR musical ♫ 🎶

This works fine.This works fine too.

If you permit me 2 more questions...
  1. Text inserted before and after the <img> tag appear on either side of the image. Is this by design? How to make text appear above or below the image with vertical line spacing? Apparently something is 'broken' in LT since 2009 according to this post and I do not understand the suggested fix: https://www.librarything.com/topic/80911#1708770
  2. The following syntax works without the use of " " (quotation marks). Is there a reason for using them?
    <A HREF="https://www.librarything.com/home">text</A>

2Nevov
Apr 17, 2022, 8:25 pm

I don't know all the reasoning, but if you formulate a link using %28 and %29 instead of the parentheses it will work, despite appearances it will get you to the intended destination:
https://en.wikipedia.org/wiki/Lord_of_the_Rings_%28musical%29

There's some information about this, called percentage-encoding, at: https://en.wikipedia.org/wiki/Percent-encoding

You can do some shenanigans to trick the forum into displaying the URL in its more visually appealing version:
1. take the original URL and wrap it in <a> tags containing the percent-encoded version:
<a href="https://en.wikipedia.org/wiki/Lord_of_the_Rings_%28musical%29">https://en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)</a>
2. the forum still tries to interpret this and cuts off the (musical) but adding some formatting tags (<b>, or <i>) in the middle will interfere with the automatic generation, and hey presto you are left with a beautiful URL:
<a href="https://en.wikipedia.org/wiki/Lord_of_the_Rings_%28musical%29">https://<b></b>en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)</a>

Gives: https://en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)

Sorry I can't help with the images though.

3mr.philistine
Modificato: Apr 18, 2022, 9:29 am

>2 Nevov: Thanks very much for taking the time to explain things.

Also using <code> tags displayed the following anomalies:

  1. no https:// displays the URL without hyperlink (as intended).
    <code>en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)</code>
    en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)

  2. with https:// still displays the partial hyperlink.
    <code>https://en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)</code>
    https://en.wikipedia.org/wiki/Lord_of_the_Rings_(musical)

    As we await the Bug Master's touch, do you know any resources that collect all HTML codes used on LT? I was able to find the following (in no particular order of importance):
    https://www.librarything.com/topic/177029
    https://www.librarything.com/topic/35356
    https://www.librarything.com/topic/129158
    https://www.librarything.com/topic/80911
    https://wiki.librarything.com/index.php/Basic_HTML_/_How_to_do_Fancy_Things_in_Y...
    https://www.freeformatter.com/html-escape.html

4conceptDawg
Mar 9, 2023, 12:48 pm

Fixed.

5mr.philistine
Mar 12, 2023, 1:45 am

>4 conceptDawg: Thank you very much! Forgive my impertinence, but what did the fix involve?

6conceptDawg
Mar 14, 2023, 5:05 pm

>5 mr.philistine: It's actually a rollback of a another fix. Our link-checking code was filtering out parens because a lot of people like to put links inside parenthesis in talk when they mention a link (like here) but our link checker removed the parens so that they wouldn't be included in the links in those cases. Parens are a legal character in links so we shouldn't necessarily do that and I've done a regression to that code and plan to go back and do a smarter checker for parens.

7fuzzi
Modificato: Mar 19, 2023, 11:03 am

>6 conceptDawg: not sure if this is related, but some of the urls on my book thread that are in parentheses are no longer links, see this post as an example:

https://www.librarything.com/topic/347135#8017704

8mr.philistine
Mar 20, 2023, 8:52 pm

>7 fuzzi: Inserting a space after/ before the link within the parentheses recreates the hyperlink like this example..

(https://www.librarything.com/topic/341255)
( https://www.librarything.com/topic/341255 )

9AnnieMod
Mar 20, 2023, 8:54 pm

>8 mr.philistine: Yes, that works of course but it was needed before the fix was implemented so all old posts are now... not linking. :)

10fuzzi
Mar 21, 2023, 12:26 pm

>8 mr.philistine: >9 AnnieMod: thank you.

It worked fine in the parentheses until recently.