typelevel / Laika

Site and E-book Generator and Customizable Text Markup Transformer for sbt, Scala and Scala.js
https://typelevel.org/Laika/
Apache License 2.0
406 stars 44 forks source link

`@:fragment`s for `PDF` output seem to be discarded #595

Closed nalkuatov closed 2 months ago

nalkuatov commented 4 months ago

https://github.com/typelevel/Laika/blob/faad62d05174b1574b704b8382f76d02937ec527/pdf/src/main/scala/laika/pdf/internal/FOConcatenation.scala#L66

Looks like fragments defined in markup are not collected in xsl-fo creation/generation stage.

jenshalm commented 4 months ago

Good spot, but somehow nobody ever noticed in all those years...

It's relatively easy to change that, but I'm not sure how to best deal with duplicate fragment names. The handling within a single document currently is that duplicates get silently dropped, but I'm not sure that's the best way to do it.

It'll be fixed at some point, but it's not high priority at the moment. If it's urgent for you right now, you can copy the sources of just the PDF renderer and adjust it yourself.