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

Fix: fix collapse selector #2113

Conversation

Embers-of-the-Fire
Copy link

Summary

The initial selector uses element.nextSibling, which may select an empty #text on Chromium-based browsers.

Here is an instance:

For a link in the sidebar, it usually seems like this:

<li>
    <a href="link" title="foo">foo</a>
    <ul class="app-sub-sidebar">...</ul>
</li>

The collapsing function uses element.nextSibling to check if collapsing is needed. However, in Chromium-based browsers, a blank text tag will possibly be inserted, making the directory unable to collapse.

bug

What kind of change does this PR introduce?

For any code change,

  • Related documentation has been updated if needed
  • Related tests have been updated or tests have been added

This is a small fix so there's no test related.

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@vercel
Copy link

vercel bot commented Jul 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docsify-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 2, 2024 11:51am

@Embers-of-the-Fire
Copy link
Author

Eee, I don't know why the ci failed, as I've tested it locally and there's no error.

@trusktr
Copy link
Member

trusktr commented Jul 3, 2023

Hello, thanks!

Eee, I don't know why the ci failed, as I've tested it locally and there's no error.

It didn't fail, I had to hit approve to make ci run.

@trusktr trusktr requested a review from a team July 3, 2023 09:14
@Koooooo-7 Koooooo-7 requested review from a team and removed request for a team September 19, 2024 05:37
@Koooooo-7 Koooooo-7 added this to the 5.x milestone Sep 19, 2024
@Koooooo-7
Copy link
Member

Hi @Embers-of-the-Fire ,sorry for the delay, could you plz solve the conflict and I will do the merge asap.
Thx in advance.

@Embers-of-the-Fire
Copy link
Author

@Koooooo-7 It has been such long time that the structure of docsify has already changed a lot :(. The bug and the code are all re-written. It seems that the bug is fixed by someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants