swiftlang/swift-markdown

Support for single backtick (`) in code voice

amartini51 opened this issue · 0 comments

This issue appears is input like the following:

In Swift, `class` isn't a valid identifier, but `` `class` `` is valid.
surround the keyword with backticks (`` ` ``) when using it as a name.

The CommonMark definition of a code voice permits one or more backticks, which supports exactly this sort of scenario where a backtick needs to appear in code voice. Additionally, escaping via backslash isn't allowed in code voice.

The issue here is a collision with DocC's extended markup using double-backticks surround links to API symbols. Currently, building "The Swift Programming Language" with top-of-tree docc, the output is correct but we get warnings like the following:

warning: '`class`' doesn't exist at .../path/to/document
warning: '`' doesn't exist at .../path/to/document

Trying 3 or 4 backticks to start/end the code voice produces the same result.

rdar://116587933