Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Parse document correctly when AMP emoji is used #79
Parse document correctly when AMP emoji is used #79
Changes from 9 commits
2f6221c
1bd3177
6efcf72
e6227be
fdaf878
27e90e0
0a766d4
ab4e380
083cd3f
0735110
8b92e2a
5b21890
bd58f49
0cd3a32
f497bec
60130e5
7719483
bde0ee8
ca995d0
c392699
07f12ac
0346a71
187bdb9
61b04d2
f8e0bb0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be made more efficient by adapting into a
preg_replace_callback
where the following code is put inside the callback. In that way, there would not be a need to do an additionalpreg_replace()
on the$source
. It could be combined with tehpreg_match()
call above as well. Something like this I believe:Note also the added limit of 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adapted to code to use a single
preg_replace_callback()
. Your code was already pretty close, but it needed a bit more fiddling with the regex pattern(s).Just to be sure, I profiled the difference across the unit tests we have that cover emojis, and this is the result:
So it's indeed a clear improvement overall.