Skip to content

Conversation

@s77rt
Copy link
Owner

@s77rt s77rt commented Apr 15, 2025

This PR is for implementing <MarkdownText /> on native. The web version will be handled separately later on.

@s77rt
Copy link
Owner Author

s77rt commented Apr 15, 2025

TODO:

  • Check s77rt comments

@s77rt
Copy link
Owner Author

s77rt commented Apr 16, 2025

I'm already facing issues with iOS, the attributed text is of type AttributedString and not NSAttributedString this means we can't apply our attributes as they are meant to work with the later.

Possible solutions:

  • Work with a new NSAttributedString then convert it to AttributedString. This is probably the best option but I don't know if the conversion is possible, react core currently does not offer such an utility, maybe we can wait to see if this changes.
  • Work with AttributedString and write new parser that works with its attributes. Not really a fan of this idea as it creates more work and we will have to get rid of the other parser and only use AttributedString.
  • Override the drawRect method and write our own drawer that takes a NSAttributedString directly (after all, the AttributedString is converted to NSAttributedString in the end). I think this is easy to do but we will have to copy some logic from react core which I don't really like as it will require maintenance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants