Skip to content

Slices of Snippets don't have indentation removed #943

Open
@Joannis

Description

@Joannis

Description

When creating a snippet with the following contents, the extra indentation of the shown code is removed to make it more readable:

// snippet.hide
import AsyncHTTPClient
import NIOCore
import Foundation

@main
struct Entrypoint {
    static func main() async throws {
        // snippet.show
        myCode()
        // snippet.hide
    }
}

However, doing the same with slices does not seem to have the same effect:

import AsyncHTTPClient
import NIOCore
import Foundation

@main
struct Entrypoint {
    static func main() async throws {
        // snippet.mySlice
        myCode()
        // snippet.end
    }
}

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

I expect the second code to render as the following in markdown:

myCode()

Actual behavior

Indentation is kept, making code unnecessarily indented.

        myCode()

Steps To Reproduce

No response

Swift-DocC Version Information

No response

Swift Compiler Version Information

No response

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