Closed maximelouet closed 5 years ago
Yeah, the naming of the method is a bit... wrong. If I had to guess it was probably originally used to images and then it somehow ended up to be used on the links too and just stuck.
Best option for this is probably creating a separate method and a matching property; if set, overrides the link prefix, leaving the current image prefix to images.
Hello, while trying for more than 30 minutes to understand why my relative anchor link was pointing to my image directory, I searched the source code and found that the
relativeImagePrefix
was applied also for relative links (with therelURL
function). I was really surprised : it's an image prefix, but it's also used for relative URLs. So, in order to create an anchor link (pointing to an element with a specific id on the same page), I either need to specify the full URL, or to disable myrelativeImagePrefix
.Maybe we could rename
relativeImagePrefix
torelativePrefix
(and have thesetRelativePrefix($prefix)
method) ? But this would lead to a big backward incompatibility. Or we could add a different attributerelativeLinkPrefix
(with its corresponding methodsetRelativeLinkPrefix($prefix)
) and use this for links only ?A solution for my specific problem would be to treat URLs starting with a
#
as absolute ones (in therelURL
function). This way, the original URL would be returned instead of the one with the prefix.Thank you for your answer.