bookdown::gitbook toc not collapsing with Safari

I recently created Geospatial Visualization using bookdown 0.23 with

bookdown::gitbook:
  config:
    toc:
      collapse: section

When viewed with Chrome or Firefox, the sections are collapsed, but not with Safari. Is there something I can do to fix this on Safari?

Books created with an older version of bookdown, such as Data Visualization, don't exhibit this problem on Safari.

Thanks

That is interesting !

I think this could be related to

You can comment there. I don't have safari so I can't test.
On thing that changed in last version is that we have update JQuery version for security reason. This could create conflict maybe ? you could check if there are error or issues in the browser console.

We may need to adapt the code specificically to Safari but that is always difficult

Just so you know, issue does not seem to be reproducible on our side. See answer here: toc collapse · Issue #1242 · rstudio/bookdown · GitHub

I tried building a new bookdown::gitbook and experienced the same problem as before with the same version of Safari that @yihui used in his video (see attached). I think the problem may be that Safari is caching a JavaScript library. When I cleared the cache, the problem disappeared. Incidentally, if you look at the video at about 0:12, all of the sections open up briefly. I don't believe this happened in the past. This behavior may disappear upon clearing the cache.

1 Like

Yes clearing the cache may help. We have changed some things regarding the JS lib and browser may differ in the way the handle cache.

Good to know it is working now !

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.