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(compiler): compute correct offsets when interpolations have HTML entities #44811

Closed
wants to merge 2 commits into from

Commits on Jan 25, 2022

  1. fix(compiler): compute correct offsets when interpolations have HTML …

    …entities
    
    When parsing interpolations, the input string is _decoded_ from what was
    in the orginal template. This means that we cannot soley rely on the input
    string to compute source spans because it does not necessarily reflect
    the exact content of the original template. Specifically, when there is
    an HTML entity (i.e. ` `), this will show up in its decoded form
    when processing the interpolation (' '). We need to compute offsets
    using the original _encoded_ string.
    
    Note that this problem only surfaces in the splitting of interpolations.
    The spans to this point have already been tracked accurately. For
    example, given the template `&nbsp;<div></div>`, the source span for the
    `div` is already correctly determined to be 6. Only when we encounter
    interpolations with many parts do we run into situations where we need
    to compute new spans for the individual parts of the interpolation.
    atscott committed Jan 25, 2022
    Configuration menu
    Copy the full SHA
    eae58a9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    12b6f5b View commit details
    Browse the repository at this point in the history