Skip to content

Commit

Permalink
Merge pull request #231 from collective/allow-skip-html-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer authored Nov 19, 2023
2 parents 56bcb0e + db0fefb commit 58b2bc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog
1.11 (unreleased)
-----------------

- Allow to use fix_html_in_content_fields without applying the default html_fixer.
[pbauer]

- Try to restore broken blobs when exporting content.
[thet]

Expand Down
8 changes: 6 additions & 2 deletions src/collective/exportimport/fix_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ def find_object(base, path):
return target


def fix_html_in_content_fields(context=None, commit=True, fixers=None):
def fix_html_in_content_fields(
context=None, commit=True, fixers=None, apply_default_fixer=True
):
"""Fix html this after importing content into Plone 5 or 6.
When calling this from your code you can pass additional fixers to modify the html.
Expand Down Expand Up @@ -296,7 +298,9 @@ def table_class_fixer(text, obj=None):
else:
if not isinstance(fixers, list):
fixers = [fixers]
fixers = [html_fixer] + [i for i in fixers if callable(i)]
fixers = [i for i in fixers if callable(i)]
if apply_default_fixer:
fixers.prepend(html_fixer)

try:
# Add img_variant_fixer if we are running this in Plone 6.x
Expand Down

0 comments on commit 58b2bc4

Please sign in to comment.