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
408 stars 44 forks source link

fix overeager validation of link target formats #538

Closed jenshalm closed 11 months ago

jenshalm commented 11 months ago

Here we go, the first 1.0-only bug fix (it's too minor for requiring a back-port with emergency release for 0.19).

The internal link validator does not only check whether a target document exist, but also if it supports at least the same set of output formats (which is configurable via laika.targetFormats = [...]). However, if the link validation happens in the final rewrite phase which is specific for each output format (resolving template nodes, etc.) then we only really care whether the link target supports the currently rendered format.

This fix prevents transformations from failing in a perfectly valid scenario.