Make Liquid TextEncoder configurable #4380
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4380
This PR also changes from HtmlEncoder to NullEncoder by default.
To configure the default encoder, do this from Program.cs:
=== auto-pr-body ===
Summary:
This pull request refactors the existing LiquidFeature and LiquidTemplateManager classes, adds a new LiquidOptions class, and adds relevant using statements.
List of Changes:
-Added using statements for System.Text, System.Text.Encodings.Web, and Fluid to the Program.cs file.
-Added a new option to the LiquidFeature class to configure the Fluid options.
-Added a new options class LiquidOptions which includes a dictionary of Fluid filter registrations, parser configurations, and a flag for allowing access to configuration objects.
-Added a TextEncoder property to the LiquidOptions class.
-Changed LiquidParser to inherit from the Fluid Parser class.
-Removed the TextEncoder from the LiquidTemplateManager constructor and updated to use encoder property from the LiquidOptions.
-Renamed FluidOptions to LiquidOptions for consistency.
-Organized the new classes and using statements in Program.cs by namespace for clarity.
-Moved new options to an "options" folder in the Elsa.Liquid module.
Refactoring Target:
This pull request refactors the LiquidFeature and LiquidTemplateManager classes, adds a new LiquidOptions class, and adds relevant using statements.