The Wayback Machine - https://web.archive.org/web/20220319011157/https://github.com/vuejs/vue/pull/9785
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(parser): fixed dynamicArgAttribute RegExp #9785

Merged
merged 3 commits into from Sep 21, 2020
Merged

Conversation

shasharoman
Copy link
Contributor

@shasharoman shasharoman commented Mar 28, 2019

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:
fixed #9781.

code explain:

const before = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
const after = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;

let s = ' #[foo]>foo</template><template #[bar]>bar</template>';

let beforeMatch = s.match(before);
let afterMatch = s.match(after);

console.log(beforeMatch[0]);     // '#[foo]>foo</template><template #[bar]'
console.log(afterMatch[0]);        // '#[foo]'

Copy link
Member

@posva posva left a comment

Could you add a test for this?
You can add to the commit message body (not the first line) fixes #9785. That way, mergin this pr will automatically close the issue

@shasharoman
Copy link
Contributor Author

@shasharoman shasharoman commented Mar 29, 2019

Could you add a test for this?
You can add to the commit message body (not the first line) fixes #9785. That way, mergin this pr will automatically close the issue

A new test case for this has been included, and I will try use it(fixes #xxx) next time, thank you.

@vuejs vuejs deleted a comment Mar 29, 2019
@tbutcaru
Copy link

@tbutcaru tbutcaru commented Apr 2, 2019

I can confirm that this fixes #9781.
Thank you, @shasharoman!

posva
posva approved these changes Apr 17, 2019
@SimplyThomas
Copy link

@SimplyThomas SimplyThomas commented Jul 25, 2019

@posva @yyx990803

Has there been any progress on this? I had to pin Vue to 2.6.9 until this gets released.

Thanks. :)

@davis90
Copy link

@davis90 davis90 commented Jan 22, 2020

Hi everyone!

What new about this ? I still have the problem in 2.6.11 reproduce here

@posva posva merged commit 67825c2 into vuejs:dev Sep 21, 2020
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants