afeld / bootstrap-toc

An automatic table of contents generator, using Bootstrap 3 or 4
https://afeld.github.io/bootstrap-toc/
MIT License
157 stars 67 forks source link

Broken unicode support on bootstrap v5 #87

Closed minghu6 closed 1 year ago

minghu6 commented 1 year ago

When I switch to bootstrap5 (using https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.bundle.min.js) according to the manual found:

Uncaught DOMException: Failed to execute 'querySelector' on 'Element': '#%E5%89%8D%E8%A8%80' is not a valid selector.
    at Object.findOne (https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:9928)
    at bn._initializeTargetsAndObservables (https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:73144)
    at bn.refresh (https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:71396)
    at new bn (https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:71269)
    at bn.getOrCreateInstance (https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:8197)
    at https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:74198
    at i (https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.bundle.min.js:6:4253)

#%E5%89%8D%E8%A8%80 is just my first heading of the nav. It's #前言

And when I rollback the setting and source to bootstrap4, all is ok.

afeld commented 1 year ago

Sorry to hear about the trouble; sounds like this is a Bootstrap issue rather than a bootstrap-toc one. https://github.com/twbs/bootstrap/issues/36939 looks like it may be the issue to follow. Good luck!