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

Resolve an edge case where last language has error #81

Merged
merged 1 commit into from Mar 6, 2019

Conversation

Projects
None yet
2 participants
@mrvdb
Copy link
Collaborator

mrvdb commented Mar 5, 2019

If there are multiple language blocks on a page, we set the
onload on the last one to load all highlighting at once.

If the last language block has an error, the onload would
never fire and thus all blocks would not be highlighted.

The simplest resolution is to fire the callback regardless. We've
already loaded everything so running the callback is not causing any
performance hit which is relevant I think.

Resolve an edge case where last language has error
If there are multiple language blocks on a page, we set the
onload on the last one to load all highlighting at once.

If the last language block has an error, the onload would
never fire and thus all blocks would not be highlighted.

The simplest resolution is to fire the callback regardless. We've
already loaded everything so running the callback is not causing any
performance hit which is relevant I think.
@thebaer

This comment has been minimized.

Copy link
Member

thebaer commented Mar 6, 2019

Thanks -- for my testing, do you have an example post where an error might happen on the last language block?

@mrvdb

This comment has been minimized.

Copy link
Collaborator Author

mrvdb commented Mar 6, 2019

@thebaer thebaer added this to the 1.0 milestone Mar 6, 2019

@thebaer

This comment has been minimized.

Copy link
Member

thebaer commented Mar 6, 2019

Perfect. Good catch, and thanks for the fix! Merging now.

@thebaer thebaer merged commit 2f683e7 into writeas:master Mar 6, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.