gonzalezreal / swift-markdown-ui

Display and customize Markdown text in SwiftUI
MIT License
2.26k stars 267 forks source link

html tag render image size too large #53

Closed jiangdi0924 closed 2 years ago

jiangdi0924 commented 3 years ago

This pkg is very helpful for me , thank you ! A bit issue when i render a html tag document , how can i fix it? `document = #"""

"""#` ![image](https://user-images.githubusercontent.com/21988177/121982504-30bd6480-cdc2-11eb-94cc-4cb7af4a0867.png)

kevoniori commented 3 years ago

You could try the following code below and adjust the parameters to your liking.

kevoniori commented 2 years ago

How did you get to render the markdown using html? Mine just spits out the plain text.

jiangdi0924 commented 2 years ago

How did you get to render the markdown using html? Mine just spits out the plain text.

try this :

import MarkdownUI

let doc = #"""
 <h2>test</h2> <p>balablalalalala</p>
"""#
Markdown(Document((doc))

Note: i find if the top level html code without <h*> tag , then the html will not render completely.

kevoniori commented 2 years ago

Tried it with your example and it worked, but I tried it with a wordpress rest api and it didnt work

gonzalezreal commented 2 years ago

HTML rendering is very limited now. I am working on improving it for version 1.0. The goal is to cover the HTML tags equivalent to markdown, both in blocks and inlines. However, a rule of thumb is to use markdown syntax when possible.