Skip to content

overriding a style doesn't work #45

Description

@lukaskollmer

Description

the readme contains the following example, of how to customize aspects of a style:

StructuredText(markdown: content)
  .textual.structuredTextStyle(.gitHub)
  .textual.headingStyle(
    CustomHeadingStyle()
  )

(followed by a sample CustomHeadingStyle)

Issue: for some reason, this doesn't work at all. Textual seems to ignore any styles that are set after setting a structuredTextStyle.
i tested this with a custom headingStyle, a custom codeBlockStyle, and a custom tableStyle, and they all got ignored (as in, it never calls the style's makeBody(configuration:) function), unless the .textual.structuredTextStyle(...) call is removed.

interestingly, if i reverse the order in which the modifiers are called, and first set the custom heading/codeBlock styles, and only then set the overall structuredTextStyle, it seems to work

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.

Textual version information

0.3.1

Destination operating system

iOS 26

Xcode version information

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