swiftlang / swift-docc-render

Web renderer for Swift-DocC documentation.
Apache License 2.0
312 stars 52 forks source link

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

Closed mportiz08 closed 4 months ago

mportiz08 commented 4 months ago

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.

mportiz08 commented 4 months ago

@swift-ci test