fix: Remove double interpolation for attachments (BREAKING) - #284
Conversation
The use case was that when using the "attachment://", it would replace the link twice, once on the "attachment://" and after that on the replace all as well as the string will be present in the replacement. This ensures that the keyword only get replcaed once. Furthermore, put "attachment://" in as a identifier for a replacement is better then nothing since you effectively create a ban word in the name of the attachement file.
|
Hey, could you please elaborate on this point?
|
|
Hey, so I'm removing the replacing "attachment name" by "path to attachment name" which only leaves the possibility to reference it by using "attachment://attachment name" to be replaced by path to attachment name. This will affect users that are currently counting on automatic replacement of their attachment filename by path to attachement name As an example: ...
<!-- Attachment: foo.txt -->
As you can read in foo.txt, blablablaToday this becomes (in confluence) To keep the same behavior users will have to use this: ...
<!-- Attachment: foo.txt -->
As you can read in attachment://foo.txt, blablabla |
|
I still don't understand the point of this PR. We are currently considering a.md: Result looks good to me: cc @mrueg |
The use case was that when using the "attachment://", it would replace the link twice, once on the "attachment://" and after that on the replace all as well as the string will be present in the replacement. This ensures that the keyword only get replcaed once.
Furthermore, put "attachment://" in as a identifier for a replacement is better then nothing since you effectively create a ban word in the name of the attachement file.
if you have an
attachement://foo, currently it get transformed into/wiki/<path>/foo?querywhich get transformed into/wiki/<path>/wiki/<path>/foo?query?querythis PR changes it to only have a single interpolation.
Note that this is a breaking change as simple text references to files will break. But it seems better to prefix it with
attachement://anyways to avoid creating ban words in your text.