Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to render custom view for links #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MoveUpwardsDev
Copy link

I based the custom view implementation on the ImageElementComposer logic so we can now provide AnyView to render a link instead of plain text.

@MoveUpwardsDev MoveUpwardsDev mentioned this pull request Dec 24, 2021
@dasautoooo
Copy link
Owner

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.

@MoveUpwardsDev
Copy link
Author

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.

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.

3 participants