Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

allow the el option to accept an HTMLElement instance #1712

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

Open
trusktr wants to merge 4 commits into develop
base: develop
Choose a base branch
Loading
from element-value-for-el-option

Conversation

Copy link
Member

@trusktr trusktr commented Jan 5, 2022
edited
Loading

Summary

The el docs say

It can be a CSS selector string or an actual HTMLElement.

which wasn't true. This change updates the code to match the docs.

Additionally this allows Docsify to be embedded in custom elements or components systems like React/Vue/Solid/etc where normally people have a reference to an element.

What kind of change does this PR introduce?

Bugfix?
Feature?

For any code change,

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

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

  • Yes
  • No

Related issue, if any:

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE
  • jsdom

Copy link

vercel bot commented Jan 5, 2022
edited
Loading

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/docsify-core/docsify-preview/GFgr7UN6pNmBGZEaRQrskSY52E5t
✅ Preview: https://docsify-preview-git-element-value-for-el-option-docsify-core.vercel.app

@trusktr trusktr requested a review from a team January 5, 2022 17:50
Copy link

codesandbox-ci bot commented Jan 5, 2022
edited
Loading

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c8141f7:

Sandbox Source
docsify-template Configuration

This aligns it with what the docs were already saying erroneously, plus
this is useful in cases when people have refs to an element already
(embedding Docsify in a custom element shadow root, or in a React
component that has a ref to the target element, etc).
Copy link
Member Author

trusktr commented Jan 7, 2022
edited
Loading

I realized that dom.getNode() has similar logic as what I implemented here. Using that would make this PR shorter.

  • use dom.getNode instead

@trusktr trusktr removed the request for review from a team January 10, 2022 03:42
@trusktr trusktr requested a review from a team January 26, 2022 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /