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

Deep copy token.attrs to avoid mutating token stream #745

wants to merge 1 commit into from


Copy link

@hukkin hukkin commented Dec 20, 2020

Please correct me if I'm wrong but I believe this line

tmpAttrs[i][1] += ' ' + options.langPrefix + langName;
will currently mutate the token stream.

This PR makes a deep copy of token.attrs so that mutating tmpAttrs[i] will not mutate token.attrs[i]

puzrin added a commit that referenced this issue Dec 20, 2020
Copy link

@puzrin puzrin commented Dec 20, 2020

Thanks! I did it a bit more light way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants