universal-vue / uvue

Vue CLI plugin to create universal Vue applications with ease
https://universal-vue.github.io/docs/
MIT License
127 stars 13 forks source link

fix: change body insert to a non-capturing group #47

Closed gwardwell closed 4 years ago

gwardwell commented 4 years ago

When the body contains the string $1 it was being treated as a token reference, which results in all $1 strings being replaced with <ssr-body />. By changing the capture group to a non-capture group, the problem is solved.

What kind of change does this PR introduce?

Fixes a bug where $1 is replaced with <ssr-body /> in the SSR page.

What is the current behavior?

If the string $1 appears anywhere in the SSR rendered HTML, it is replaced with <ssr-body />.

What is the new behavior?

Occurrences of the string $1 are now left alone.

Checklist:

NOTES:

It was difficult for me to track how the unit test mocks work, so I didn't update the tests to include the $1 string.

yabab-dev commented 4 years ago

Thanks!