Skip to content

Simplify converter chain to avoid duplication #834

Closed

Description

@RubenVerborgh

#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

  1. changed the title [-]Simplify converter chain[/-] [+]Simplify converter chain to avoid duplication[/+] on Jul 22, 2021
  2. jvherweg commented on Jul 23, 2021

    @jvherweg
    Member
  3. RubenVerborgh commented on Jul 23, 2021

    @RubenVerborgh
    MemberAuthor

    But that's if no conversion is needed. The additional case is: if no conversion improves the result.

  4. jvherweg commented on Nov 8, 2021

    @jvherweg
    Member

    Done in #1030. Will be part of v3.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions