Skip to content

Rename #main to #app-main for better compatibility with content #869

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

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

mportiz08
Copy link
Contributor

Bug/issue #, if applicable: #788, 110847532

Summary

Renames the #main identifier for <main> elements to #app-main. By using a more specific name, we can avoid problems where this identifier conflicts with the identifier for a subsection in the content itself.

There is a specific instance of this issue happening for the Swift Programming Language book, where a link to a section called "main" incorrectly goes to the top of the page.

Testing

Steps:

  1. Start the dev server with VUE_APP_DEV_SERVER_PROXY=https://docs.swift.org/swift-book npm run serve
  2. Open http://localhost:8080/documentation/the-swift-programming-language/attributes/#UIApplicationMain and click the link to the "main" section at that part of the page
  3. Verify that the link brings you to the "main" subsection and not the top of the page
  4. Verify that there are no regressions with other behavior attached to the old #main id, like the skipnav

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran npm test, and it succeeded
  • Updated documentation if necessary

This resolves a specific issue where the swift-book has a subsection for
a symbol called "main", so links to this section don't work as intended.

This issue could still pop up in other places, but this should help
resolve a more common instance that is impacting existing content.
@mportiz08 mportiz08 requested review from marinaaisa and hqhhuang June 24, 2024 23:36
@mportiz08 mportiz08 linked an issue Jun 24, 2024 that may be closed by this pull request
@mportiz08
Copy link
Contributor Author

@swift-ci test

@mportiz08 mportiz08 merged commit 5248ab0 into swiftlang:main Jun 26, 2024
1 check passed
@mportiz08 mportiz08 deleted the rename-main-id branch June 26, 2024 16:47
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.

#main anchor issue on Attributes page
2 participants