📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

URL & Brackets

Options
Probably easier said than implemented, but I notice quite often that people using brackets can accidentally break URL's.

To make it obvious, what I mean is this (https://www.moneysavingexpert.com/).

In this example, it correctly identifies that http is the prefix for a URL and correctly creates a hyperlink, but it incorrectly ends the link with the bracket.

There must be some logic governing this, as in this example, it doesn't include the full stop as part of the URL. 

Now the simple fix for the user is to put a space before the last bracket, but this feels unnecessary and assumes they notice. I'm sure many viewers may just assume the wrong link was posted.

I don't think that many URL's ever end in a closed bracket, so I'd suggest excluding this from URL's using the same logic that excludes the full stop in the above, or a space.

A real world example of the issue:

https://forums.moneysavingexpert.com/discussion/6542679/john-lewis-purchase-didnt-complete-sale-now-over-anything-i-can-do#latest
Know what you don't

Comments

  • booneruk
    booneruk Posts: 735 Forumite
    Sixth Anniversary 500 Posts Name Dropper
    It looks as if the forum software isn't clever enough to remove the bracket at the end, but it is removing the bracket at the start! Very odd indeed. 

    If it detects a bracket at the start and there is a corresponding closing bracket at the end - cut that off too. Shouldn't be too hard.

    It might be a bug within logic performing a string slice/substring operation that needs a -1 applied to the end index.


  • Exodi
    Exodi Posts: 3,956 Forumite
    Eighth Anniversary 1,000 Posts Name Dropper Combo Breaker
    edited 22 July 2024 at 1:48PM
    booneruk said:
    It looks as if the forum software isn't clever enough to remove the bracket at the end, but it is removing the bracket at the start! Very odd indeed. 

    If it detects a bracket at the start and there is a corresponding closing bracket at the end - cut that off too. Shouldn't be too hard.

    It might be a bug within logic performing a string slice/substring operation that needs a -1 applied to the end index.


    It's not clever enough to remove the bracket at the start - https://X is the start of a hyperlink.

    It's not an MSE problem, but it does have workarounds: https://blog.codinghorror.com/the-problem-with-urls/
    Know what you don't
  • booneruk
    booneruk Posts: 735 Forumite
    Sixth Anniversary 500 Posts Name Dropper
    edited 22 July 2024 at 1:59PM
    I can well imagine it's tricky sometimes. I've had similar challenges throughout my career.

    Of course, someone could actually run a URL with brackets in it too. https://testsite.net/) could be a valid working URL. Without checking it, you wouldn't know.

    https://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Content-urlcharacters

  • MSE_Stephen
    MSE_Stephen Posts: 777 Community Admin
    Part of the Furniture 500 Posts Combo Breaker Savvy Shopper!
    Hi everyone

    We are currently using a legacy editor while we wait for some improvements to be made to a new version we hope to use in the future. 

    I just did a quick test to see what will happen when we switch to the new editor -

    if you use brackets, then that makes the link remain as text rather than trying to hyperlink.

    But usually for hyperlinks when you type or paste, the link will automatically change - giving you a choice for the format of the link:




    Join the MSE Forum
    Get the Free MoneySavingExpert Money Tips E-mail
    To report inappropriate posts: click the report button
    Flag a news story:
    news@moneysavingexpert.com
  • Exodi
    Exodi Posts: 3,956 Forumite
    Eighth Anniversary 1,000 Posts Name Dropper Combo Breaker
    Great, sounds like it won't be an issue for the new editor.
    Know what you don't
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 351.1K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.6K Spending & Discounts
  • 244.1K Work, Benefits & Business
  • 599K Mortgages, Homes & Bills
  • 177K Life & Family
  • 257.4K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.