Skip to content

Resolve an edge case where last language has error#81

Merged
thebaer merged 1 commit intowritefreely:masterfrom
mrvdb:codehighlight
Mar 6, 2019
Merged

Resolve an edge case where last language has error#81
thebaer merged 1 commit intowritefreely:masterfrom
mrvdb:codehighlight

Conversation

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

mrvdb commented Mar 6, 2019 via email

@thebaer thebaer added this to the 1.0 milestone Mar 6, 2019
@thebaer
Copy link
Copy Markdown
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.

2 participants