gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.25k stars 268 forks source link

Support the Apple swift-markdown library #102

Closed jbeder closed 1 year ago

jbeder commented 2 years ago

Apple now has a Swift markdown package of its own: https://github.com/apple/swift-markdown

It's based on cmark as well. There are two main issues:

  1. If an app depends both on that package and this one, then it'll have duplicate symbols from cmark since this package embeds cmark.
  2. swift-markdown defines a Document type like the SwiftCommonMark package that this one depends on, so even if the linker error is resolved, you'd still have to use SwiftCommonMark's Document instead of the swift-markdown one. It'd be nice to be able to use the official supported one.

(This issue comes from the fact that I was already using the swift-markdown package, and I wanted to render it in SwiftUI, so I tried using this package - which looks awesome, btw! - but I couldn't.)

LiYanan2004 commented 1 year ago

Check out my implementation with Apple's swift-markdown. MarkdownView

gonzalezreal commented 1 year ago

Hi @jbeder,

I would love to adopt apple/swift-markdown for MarkdownUI, but sadly, the way Apple versions this package makes it a bit difficult:

https://forums.swift.org/t/what-exactly-do-release-tags-mean-for-packages-like-swift-markdown-swift-syntax-etc/58382

I want to avoid adding a dependency with a branch or exact revision requirements as it can be problematic and lead to these kinds of errors: #19.