Skip to content

sort element attributes#2

Open
michal-h21 wants to merge 1 commit intoforflo:masterfrom
michal-h21:sort_attr
Open

sort element attributes#2
michal-h21 wants to merge 1 commit intoforflo:masterfrom
michal-h21:sort_attr

Conversation

@michal-h21
Copy link

Hi, thanks for this library. I use it in few project, together with a simple static site generator. One issue I found is that the order of attributes in elements changes in subsequent runs of the generator. Because of this, these HTML files are detected as changed by Git or Rsync, even if their content didn't change at all.

This patch sorts the attributes alphabetically, so their order don't change anymore. It seems that it doesn't affect speed noticeably, at least not on my test case of 500 files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments