Skip to content

StructuredText doesn't render collapsible sections using GitHub flavored Markdown #33

@sbeitzel

Description

@sbeitzel

Description

GitHub's flavor of Markdown includes a pair of tags, <details> and <summary>, which allow creation of collapsible / expandable sections of a document see documentation.

StructuredText, when given Markdown containing these blocks, does not render the summary with a disclosure widget (see documentation referenced above). Instead, it renders the tag literals. This is a graceful failure, as it does mean that the collapsible content is still rendered, but it is a sub-optimal result.

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • 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 or discussion.

Expected behavior

Given a Markdown sample:

# Some Header
<details>
<summary>This gets big</summary>
Lots of text appears here
</details>

... one expects a StructuredText(markdown: sampleMarkdown).textual.structuredTextStyle(.gitHub) to render the sample as GitHub does:

Some Header

This gets big Lots of text appears here

Actual behavior

What currently gets rendered is the text but the section blocks are rendered as tags:

Some Header

<details>
<summary>This gets big</summary>
Lots of text appears here
</details>

Steps to reproduce

sample_repro.tgz

Textual version information

0.3.1

Destination operating system

macOS 26.3

Xcode version information

Version 26.3 (17C529)

Swift Compiler version information

swift-driver version: 1.127.15 Apple Swift version 6.2.4 (swiftlang-6.2.4.1.4 clang-1700.6.4.2)
Target: arm64-apple-macosx26.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions