Enonic version: 4.7.11
OS: OS X / Linux
When creating custom content in an htmlarea
input field, I want to create a link to another page. These are the steps needed to reproduce:
- Mark some text and create a link
- Choose
type: page
and select a page to link to - Set
Anchor
to the ID I want to scroll to on the page I am linking to - Save the link. The HTML now shows
<a href="page://12406#my-anchor-tag">Testlink</a>
When I publish this, the href reads [undefined]: Invalid MenuItemKey: 12406#my-anchor-tag
.
Removing the anchor fixes the problem. This leads me to conclude that you try to look up the menu item key 12406#my-anchor-tag
, instead of 12406
, and then appending #my-anchor-tag
, which I would assume is the expected behavior.
Another related “bug” - or weakness, perhaps - is that if you start your anchor with a hashtag (#
), you get two hashtags. I suggest you add a check for this.
Best regards,
Kristofer Selbekk