Closed igregson closed 1 year ago
Can you give a few examples of relative links you're having trouble with in your HTML code, please?
Can you give a few examples of relative links you're having trouble with in your HTML code, please?
Sure, here are a few examples:
<a href="/blog/recipes/homemade-ginger-ale-benefits-recipe">Read more</a>
<a href="/shop/product/manuka-honey/14136">Manuka honey</a>
<a href="/shop/product/ginger-root-powder-organic/8214">ginger root</a>
That's the source of the HTML. Copy and pasting that directly into the writer field simply pastes it as text (it doesn't parse it into actual markup). To reproduce the behavior I'm referring to above (where Kirby is rewriting relative URLs into absolute ones), copy and paste rendered markup from an HTML page that has relative links.
After looking into this further, it seems the issue is a browser behavior/bug rather than anything specific to Kirby.
Pretty surprised by this! I've shared my findings with details and screenshots to illustrate the issue here (https://stackoverflow.com/a/74360092/1971662).
Since this isn't Kirby-specific I'm going to close this. Sorry for the noise!
Description
It should be possible to paste HTML into the writer field without it transforming relative links (href values) into absolute links.
This being the default and only behavior assumes that the panel's hostname is the same as the frontend's hostname. But this is not always the case, especially for headless Kirby.
Moreover, there are valid cases for wanting to preserve relative link URLs when pasting into the writer field.
Your setup
Kirby Version
3.8.1.1