Skip to content
This repository has been archived by the owner on Jul 1, 2019. It is now read-only.

cloudinary image replacements in format_post() are too greedy #485

Open
nottrobin opened this issue Feb 13, 2019 · 1 comment
Open

cloudinary image replacements in format_post() are too greedy #485

nottrobin opened this issue Feb 13, 2019 · 1 comment
Assignees

Comments

@nottrobin
Copy link
Contributor

nottrobin commented Feb 13, 2019

This regex:

https://github.com/canonical-websites/blog.ubuntu.com/blob/2062ed1fa8e55e56142707c02040d49a32b54564/helpers.py#L124

Is too greedy. It results in any src="..." following an img being replaced, whether or not it's actually a property of the same element. It can easily catch srcs in code snippets etc., and ones that don't actually belong to <img> elements.

This can be quite frustrating for people trying to publish blog posts with code snippets.

@nottrobin
Copy link
Contributor Author

nottrobin commented Feb 13, 2019

We should probably use beautifulsoup rather than regex

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants