We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Same as fix_html_in_content_fields is should be possible to pass additional fixers.
An example I used recently is to scale all unscaled images:
def scale_unscaled_images(text, obj=None): """Scale unscaled image""" if not text: return text fallback_scale = "huge" soup = BeautifulSoup(text, "html.parser") for tag in soup.find_all("img"): if "data-val" not in tag.attrs: # maybe external image continue scale = tag["data-scale"] # Prevent unscaled images! if not scale: scale = fallback_scale tag["data-scale"] = fallback_scale if not tag["src"].endswith(scale): tag["src"] = tag["src"] + "/" + scale return soup.decode()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Same as fix_html_in_content_fields is should be possible to pass additional fixers.
An example I used recently is to scale all unscaled images:
The text was updated successfully, but these errors were encountered: