Hyperlink automatic processing bug

Platform Website

Browser Chrome

URLs (aka web addresses) of any relevant observations or pages: https://www.inaturalist.org/flags/539446#activity_comment_1eb29ac0-a377-44c6-8dca-cf6a5be77e10

Screenshots of what you are seeing
image

Description of problem
When posting the following hyperlinks the automatic hyperlink processing seem to fails to parse them how I would expect.

https://www.environment.vic.gov.au/__data/assets/pdf_file/0024/32568/Bald_Tip_Beard_Orchid_Calochilus_richiae.pdf

https://www.environment.vic.gov.au/__data/assets/pdf_file/0024/48831/VBA-Restricted-Taxa.pdf

I assume this is due to the double underscore (__).

Edit: Although it seems to work fine here.

That does seem like a bug, but we’ll see what the developers have to say. As a work-around for now, it should work to put them in as HTML hyperlinks:

<a href="https://www.environment.vic.gov.au/__data/assets/pdf_file/0024/48831/VBA-Restricted-Taxa.pdf">https://www.environment.vic.gov.au/__data/assets/pdf_file/0024/48831/VBA-Restricted-Taxa.pdf</a>

2 Likes

That seems to only work for the first link i use with that issue. But I did just find i can use it like on the forum [Text] (Link) which is preferable to just pasting the link.
I also noticed I don’t get any any notification for a flag I submitted being resolved (even if I comment on it) but I do get a notification if another persons flag I have commented on gets resolved. Seems odd.

I haven’t been able to replicate this either on our test server or production server. Screenshot from test server below:

When I click on the links I download the correct PDFs.

If you can provide replicatable conditions, please file a bug report.

Thanks for checking it out. I am not sure why it can’t be recreated I still get the same issue. Just tried it again here with Chrome and Firefox (in case that was somehow involved…) and got the same issue. It seems to only occur with links. When I click I still can’t get the PDF as the link shows “https://www.environment.vic.gov.au/data/assets/pdf_file/0024/48831/VBA-Restricted-Taxa.pdf

At least I have found a great workaround which makes things much cleaner and is how I should have been doing things from the start! (I did not know that the “Text” style formatting worked outside of the forum.)

In case it helps at all this is the code I see when I inspect that element:

As for the notifications I am not sure exactly how to show that. I next time I get a flag resolved I will submit a bug showing I have no notifications. Is just something like this where I have had several of my own flags resolved in this time frame enough for submitting a separate bug report?

Interesting… I think it has to do with editing the comment.
image
I suspect if i went back in and hit edit on that comment and saved again it would break that last link.

Well I would suspect wrong!

So now I am not sure… Still feels like editing has something to do with it…

Here is what I see before I save an edit:


And after:
image

the equivalent syntax for <strong> </strong> html tags in markdown is __ __.

it looks like the markdown interpreter in iNaturalist.org is interpreting the __ in your first link as a <strong> and the __ in your second link as a </strong> if it’s not clear that the two links exist in separate containers.

it looks like by default, the logic that parses the text into html will treat lines separated by just a single line break as a single paragraph having a line break inside <p><br></p> instead of being separate paragraphs <p></p><p></p>. so i think the simplest thing to do here is either:

  1. add another line break indicate the links belong in separate paragraphs, or
  2. add bullets to indicate that the links are separate items in a list.

i suspect the effort that it would take to try to address this technically would not be worth the benefit, especially considering how easy it is to avoid the issue.

the screenshots below show how iNaturaist.org parses out the 3 different cases.

line break:

separate paragraphs:

list:

2 Likes

@pisum Thanks for the detailed investigation and explanation. As far as I am concerned I am happy with the work arounds and I don’t see or use many links with “__” other than these DELWP ones. Assuming the staff feel the same I am happy for this to be closed and if others run into the same problem they can at least see the work arounds suggested here.

1 Like