Parma
Parma copied to clipboard
Add ability to render custom view for links
I based the custom view implementation on the ImageElementComposer
logic so we can now provide AnyView
to render a link instead of plain text.
Hi @MoveUpwardsDev ,
Thank you for your PR. I see the need to provide customization to the hyperlinks, like using AttributedString
to make the link actually a link.
As I saw in the code changes, the InlineElementComposer
became BlockElementComposer
, which will result in the link element cannot concatenate with plain texts and any other text elements. Because BlockElement's rendering logic is to stack each other one by one.
I'm wondering why to modify it, and if there are any possibilities to make it an InlineElement
.
Thanks anyway.
If I'm not mistaken links in markdown are in the form of [text](url)
so no need for concatenation, right? I could not manage to use InlineElementComposer
to render AnyView
. This way you can return any type of view such as Button
which was the purpose of doing this PR. But I might have missed some regression in your library. None that I've seen by the way with my markdown documents.