Home > Net >  Markdown multiline link support
Markdown multiline link support

Time:04-26

I'm currently trying to add a multiline text with several links and it seems that the link stops working on line break, any suggestions on how to fix this? Thanks!

 Text("I agree with [Privacy Policy](https://url.com) and [Terms of service](https://url.com/tos)") 

I tried adding fixed line breaks with \n, but that didn't have any effect. I've also tried adding try! AttributedString(markdown: ) but that as well didn't achieve my desired goal.

CodePudding user response:

Try multi-line strings.

Text("""
     I agree with [Privacy Policy](https://url.com)
    and [Terms of service](https://url.com/tos)
""")

example-1

HStack{
    Text("""
    Spausdami registruotis sutinkate su mūsų [Privatumo Politika](https://darbomanija.lt/privacy)
    ir [Naudojimosi Taisyklėmis](https://darbomanija.lt/tos)
    """)
}

example-2

  • Related