Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Liquid TextEncoder configurable #4380

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

sfmskywalker
Copy link
Member

@sfmskywalker sfmskywalker commented Aug 30, 2023

Fixes #4380

This PR also changes from HtmlEncoder to NullEncoder by default.
To configure the default encoder, do this from Program.cs:

services.AddElsa(elsa => elsa.UseLiquid(liquid => liquid.FluidOptions => options => options.Encoder = HtmlEncoder.Default));

=== 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.

@sfmskywalker sfmskywalker merged commit 9d4add7 into v3 Aug 30, 2023
2 checks passed
@sfmskywalker sfmskywalker deleted the v3-liquid-js-encoding branch August 30, 2023 17:09
@sfmskywalker sfmskywalker added enhancement New feature or request elsa 3 This issue is specific to Elsa 3 labels Aug 30, 2023
@sfmskywalker sfmskywalker added this to the Elsa 3.0 RC2 milestone Aug 30, 2023
@sfmskywalker sfmskywalker self-assigned this Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elsa 3 This issue is specific to Elsa 3 enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant