Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure Id for NodeDocComponent is unique
Before, this generated the same Id for any component that had the same content no matter the tag or attributes, which leads to problems with empty components: <ColorCard color="#FF00000"></ColorCard> and <TableOfContents></TableOfContents> got the same Id. Adding the position to the string to be hashed ensures uniqueness.
- Loading branch information
6583933
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice way to fix this! Instead of making the position part of the hash by adding it to the content which is than hashed, it would be more correct to initialize the hash once, and than update with the contents and than with the position, as in https://gobyexample.com/sha1-hashes