Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New implementation which keeps nested HTML tags
The previous implementation pushed with commit 83c7f8f fails the tests and I believe is wrong. As far as I can understand .textNodes() returns a list of all text nodes of the current element, which are then stripped of the --i18n.key-- annotations. The trouble is that .textNodes() uses .contents() which only searches the immediate children in the DOM tree. Thus is we have nested HTML tags the text nodes of these nested tags are not returned and the i18n annotations are not removed. This is indeed what is causing the existing tests to fail: https://travis-ci.org/railslove/i18n_viz/jobs/158501488 This new implementation doesn't use .textNodes() and instead recurses into child nodes on its own.
- Loading branch information