-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Don't break TOC when OpenAPI description includes headers
As noted in [0], the ability to render a CommonMark document through OpenAPI specifications' `info.description` is breaking due to how the Table of Contents code works. We'd assumed that the `id` would always be set on headers - by Middleman - but as it's possible for an OpenAPI description to include headers, we won't always have one. To solve this, we can make it possible for a link to not be present for a heading, instead returning just a `<span> for the table of contents. This allows the headings to still be present, but won't be actionable. Until the `openapi3_parser` gem supports making this configurable, i.e. be allowing us to inject in headers, this is a good middle ground. [0]: alphagov/tdt-documentation#156
- Loading branch information
1 parent
ee6b8aa
commit a6df7c1
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters