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

Invalid extraction text issue (BACKPORT to 10.2.x) #39589

Commits on Nov 6, 2020

  1. fix(compiler): ensure that i18n message-parts have the correct source…

    …-span
    
    In an i18n message, two placeholders next to each other must have
    an "empty" message-part to separate them. Previously, the source-span
    for this message-part was pointing to the wrong original location.
    This caused problems in the generated source-maps and lead to extracted
    i18n messages from being rendered incorrectly.
    petebacondarwin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    92168ab View commit details
    Browse the repository at this point in the history
  2. refactor(compiler): store the fullStart location on ParseSourceSpans

    The lexer is able to skip leading trivia in the `start` location of tokens.
    This makes the source-span more friendly since things like elements
    appear to begin at the start of the opening tag, rather than at the
    start of any leading whitespace, which could include newlines.
    
    But some tooling requires the full source-span to be available, such
    as when tokenizing a text span into an Angular expression.
    
    This commit simply adds the `fullStart` location to the `ParseSourceSpan`
    class, and ensures that places where such spans are cloned, this
    property flows through too.
    petebacondarwin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    6363101 View commit details
    Browse the repository at this point in the history
  3. refactor(compiler): capture fullStart locations when tokenizing

    This commit ensures that when leading whitespace is skipped by
    the tokenizer, the original start location (before skipping) is captured
    in the `fullStart` property of the token's source-span.
    petebacondarwin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    fb7c9aa View commit details
    Browse the repository at this point in the history
  4. fix(compiler): skipping leading whitespace should not break placehold…

    …er source-spans
    
    Tokenized text node may have leading whitespace skipped from their
    source-span. But the source-span is used to compute where there are
    interpolated blocks, resulting in placeholder nodes whose source-spans
    are offset by the amount of skipped characters.
    
    This fix uses the `fullStart` location of text source-spans for computing
    the source-span of placeholders, so that they are accurate.
    
    Fixes angular#39195
    petebacondarwin committed Nov 6, 2020
    Configuration menu
    Copy the full SHA
    c392654 View commit details
    Browse the repository at this point in the history