Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nested tags, make tests pass #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 5, 2017

  1. Configuration menu
    Copy the full SHA
    d9abc44 View commit details
    Browse the repository at this point in the history
  2. 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.
    atodorov committed Jun 5, 2017
    Configuration menu
    Copy the full SHA
    43e7724 View commit details
    Browse the repository at this point in the history