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

mrvdb
Copy link
Collaborator

@mrvdb 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.

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
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
Copy link
Collaborator Author

mrvdb commented Mar 6, 2019 via email

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

thebaer commented Mar 6, 2019

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

@thebaer thebaer merged commit 2f683e7 into writefreely:master Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants