Skip to content

convert and preview commands crash on certain Markdown pages #678

Closed
@MaxDesiatov

Description

@MaxDesiatov

Description

When rendering Swift compiler documentation the diagnostics formatting code crashes on certain Markdown pages.

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

No crashes.

Actual behavior

Swift/StringCharacterView.swift:158: Fatal error: String index is out of bounds

Steps To Reproduce

  1. Clone https://github.com/apple/swift.git
  2. Install a recent development snapshot of Swift, I'm using swift-DEVELOPMENT-SNAPSHOT-2023-07-23-a.
  3. Run DocC from this snapshot this way (assuming swift is the clone from step 1):
docc preview --allow-arbitrary-catalog-directories swift/docs

Swift-DocC Version Information

swift-DEVELOPMENT-SNAPSHOT-2023-07-23-a

Swift Compiler Version Information

Apple Swift version 5.9-dev (LLVM 9b562f55c38e378, Swift b4ee68bd37c4f7d)
Target: arm64-apple-macosx14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions