Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Different relative prefixes for images and links #169

Closed
maximelouet opened this issue Sep 2, 2016 · 1 comment
Closed

Different relative prefixes for images and links #169

maximelouet opened this issue Sep 2, 2016 · 1 comment

Comments

@maximelouet
Copy link

maximelouet commented Sep 2, 2016

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 the relURL 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 my relativeImagePrefix.

Maybe we could rename relativeImagePrefix to relativePrefix (and have the setRelativePrefix($prefix) method) ? But this would lead to a big backward incompatibility.
Or we could add a different attribute relativeLinkPrefix (with its corresponding method setRelativeLinkPrefix($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 the relURL function). This way, the original URL would be returned instead of the one with the prefix.

Thank you for your answer.

@maximelouet maximelouet reopened this Sep 2, 2016
@netcarver netcarver added this to the 3.7.0 milestone Nov 17, 2016
@gocom
Copy link
Member

gocom commented Oct 20, 2018

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.

@gocom gocom self-assigned this Oct 20, 2018
gocom added a commit that referenced this issue Oct 20, 2018
@gocom gocom removed their assignment Oct 20, 2018
@gocom gocom closed this as completed in 8421309 Nov 13, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants