Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

Custom attributes #3

Open
mikepulaski opened this issue Apr 2, 2020 · 1 comment
Open

Custom attributes #3

mikepulaski opened this issue Apr 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mikepulaski
Copy link
Contributor

I think it'd be neat to be able to provide custom attributes when creating attributed strings. For example, a chat application might want to make headers bold without altering the size, or a note-taking application might want to render links with a specific a tint color.

I think this could be done fairly easily by adding an optional parameter (where appropriate) such that the existing API signature(s) don't change and the current attributes are used as default values.

Do you have any thoughts on this? I'd be happy to make a PR (plus any tweaks based on your feedback) if this is something you'd like upstream.

Thanks again for sharing!

@mikepulaski
Copy link
Contributor Author

mikepulaski commented Apr 3, 2020

Here's another scenario I encountered where customizable attributes could be handy. It seems that the attributed string doesn't handle line breaks properly, but I can't override the library's attributes to fix it :(

It has **bold** and _italic_.

# Here's a header

> With some content
> in a quote

Very interesting. [view source](#)

## Here's a sub header

- we
- have
- lists

1. they
2. can
3. be
4. ordered

Screenshot 2020-04-03 at 16 35 02

@mattt mattt added the enhancement New feature or request label May 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants