Skip to content

withfaces doesn't apply to constructed StyledStrings #87

Description

@topolarity

I'd have expected styling to be applied at string construction, so that:

const alert_msg = withfaces(:banner => Face(foreground = :red)) do
    styled"{banner:text}"
end
println(alert_msg)

prints "text" in red. Instead, it prints without styling.

IMO this is a subtle but important difference between what I'd expect to be a StyledString vs. an AnnotatedString.

If you want to carry around style information with your string (I almost always do), I have to shuttle around the Faces I need to the presentation layer somehow - which is especially unclear how to do if I wanted to do AbstractString-style operations on this in a way that preserves styling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions