Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slices of Snippets don't have indentation removed #943

Open
1 of 2 tasks
Joannis opened this issue Jun 8, 2024 · 1 comment
Open
1 of 2 tasks

Slices of Snippets don't have indentation removed #943

Joannis opened this issue Jun 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Joannis
Copy link
Member

Joannis commented Jun 8, 2024

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

@Joannis Joannis added the bug Something isn't working label Jun 8, 2024
@tayloraswift
Copy link
Member

i wasn’t able to reproduce this on version 1.3.0 of swift-docc-plugin:

image

what version are you on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants