cobrateam / cobrateam/django-htmlmin
HTML space entities are changed into regular spaces
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 542
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
BeautifulSoup's formatter='html' should probably be used, although it would be nice not to have all unicode characters converted to entities.
Additionally, space between a button and a another tag like a link is lost.
Example source file:
<!DOCTYPE html>
<html>
<body>
<p>A paragraph with a non-breakable space</p>
<p>And one with various spaces</p>
<a href="#">A link</a>
<button>A button</button>
</body>
</html>
Minified output:
<!DOCTYPE html><html><head></head><body><p>A paragraph with a non-breakable space</p><p>And one with various spaces</p><a href="#">A link</a><button>A button</button></body></html>
Pictures (input on the left, output on the right):

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the HTML example and the minifier's BeautifulSoup formatter='html' path. Compare handling of , , , and , along with whitespace between the link and button. Done means the documented space entities and inter-element spacing are preserved as intended without converting every Unicode character to an entity.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100