Links & anchors in journal posts

Website Brave & Firefox on Ubuntu Studio 20.04

e.g. https://www.inaturalist.org/projects/pillar-parade-s-afr/journal/68613-the-power-of-annotations

Description of problem I have placed <a href> links & anchors in this journal post, but the links don’t work. They are blue as links, but when clicked on they do not take one to the relevant sections (nothing happens).

  • I have used Formatting:None and included all html tags.
  • iNat added the full URL to the link tags on the published post
  • I have made sure that the quotes are not “real” quotes (as per this post)

a href link
anchor1

anchor id
anchor2

the website seems to be stripping certain attributes from your html tags, including h1.id. (i assume this is done to prevent you from accidentally using ids used by the page and possibly to prevent certain attacks.)

that said, you can probably still use the old way of defining anchors, which would be something like:

<a name="targetname">
  <h2>target</h2>
</a>

then you can reference the target by using something like:

<a href="#targetname">link</a>

btw – i don’t think the stripping of attributes from user-defined html tags is a bug. it’s probably done on purpose. so i doubt the developers would do anything to change it.

1 Like

Thank you @pisum , so helpful, as always! You rock :-)

This works - yay!

1 Like