Skip to content

Add dedicated docs for innerHTML and textContent #1105

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

Conversation

amirhhashemi
Copy link
Collaborator

  • I have read the Contribution guide
  • This PR references an issue (except for typos, broken links, or other minor problems)

Description(required)

innerHTML and textContent are documented on the same page, which may lead to some issues:

  1. They serve different purposes, and placing them together could be misleading. The title of the page separates the two with "or," suggesting they are equivalent, when in fact they are not. Additionally, using innerHTML has certain security implications that should be considered.
  2. This arrangement disrupts the consistency of the API reference docs. Unrelated topics should not be documented on the same page.
  3. Some users might be looking specifically for information about innerHTML, as it is more widely used. Including information about textContent can create unnecessary friction.
  4. I found that innerText is not documented either. Should we also add its docs to the same page?

Furthermore, there were a few issues with the content itself:

  1. The first two sentences are unclear and confusing:

    "These work the same as their property equivalent. Set a string and they will be set."

  2. The example provided was not useful, so I removed it.

This PR addresses these issues. Additionally, I updated the the legacy routes redirector middleware to redirect to the innerHTML page. This further highlights the problem of documenting multiple concepts on one page, as it limits our control over the URLs.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

netlify bot commented Mar 2, 2025

Deploy Preview for solid-docs ready!

Name Link
🔨 Latest commit 0b2abe1
🔍 Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/67c47086f7c5460008bc2162
😎 Deploy Preview https://deploy-preview-1105--solid-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 2, 2025

Deploy Preview for solid-docs failed. Why did it fail? →

Name Link
🔨 Latest commit b17b697
🔍 Latest deploy log https://app.netlify.com/sites/solid-docs/deploys/67cbc9d665391e0008eb210f

@LadyBluenotes LadyBluenotes merged commit 7698f9b into solidjs:main Mar 8, 2025
2 of 8 checks passed
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