You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Simplify converter chain to avoid duplication #834
#833 introduces the MarkdownConverter in the conversion chain, such that it now appears above IfNeededConverter and as part of the ChainedConverter. The reason is that, when a browser requests a document that is originally Markdown, the server would settle for the Markdown representation since browsers accept */* and IfNeededConverter introduces a barrier. Hence, the Markdown conversion would only be triggered for rendering error pages etc.
This duplication can become complicated if there are more and more converters.
However, the IfNeededConverter is needed to avoid erroring on non-covertible document types.
We might instead want to remove MarkdownConverter and IfNeededConverter from the chain, and add a DoNothingConverter to the chain, such that there is always a conversion. (This specific solution might however increase the complexity of chained path construction, since it always matches. So maybe it's better as a configuration option to ChainedConverter instead, to allow a zero-length chain.)
Activity
[-]Simplify converter chain[/-][+]Simplify converter chain to avoid duplication[/+]jvherweg commentedon Jul 23, 2021
I just discovered that the
ChainedConverteralready does a content-type check before starting conversion https://github.com/solid/community-server/blob/850c590a5185b75c55a1060cd35a8d155d91b36a/src/storage/conversion/ChainedConverter.ts#L179-L183RubenVerborgh commentedon Jul 23, 2021
But that's if no conversion is needed. The additional case is: if no conversion improves the result.
jvherweg commentedon Nov 8, 2021
Done in #1030. Will be part of v3.0.0 release.