You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code is :
let markdownString = ""
Colons can be used to align columns.
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
The outer pipes (|) are optional, and you don't need to make the
raw Markdown line up prettily. You can also use inline Markdown.
Markdown | Less | Pretty
--- | --- | ---
*Still* | `renders` | **nicely**
1 | 2 | 3
1. First ordered list item
2. Another item
⋅⋅* Unordered sub-list.
1. Actual numbers don't matter, just that it's a number
2. Ordered sub-list
3. And another item.
To have a line break without a paragraph, you will need to use two trailing spaces.⋅⋅
Note that this line is separate, but within the same paragraph.⋅⋅
(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)
* Unordered list can use asterisks
- Or minuses
+ Or pluses
""
var style = DefaultStyle()
let finalText = doc.attributedText(style: style)
sampleTextView.attributedText = finalText
Table view is not supported also new line after every item in an ordered/unordered list is not rendering at all, instead all are displayed as a single paragraph . Please help !
The text was updated successfully, but these errors were encountered:
Tables are not currently supported for the attributedText method, but they are supported by the parser. It might be possible to add support for macOS by using NSTextTable, but that is not supported on iOS.
If you need to support tables, you may want to try https://github.com/KristopherGBaker/TexturedMaaku if your target is iOS, or you can build your own renderer if your target is not iOS or you don't want to use Texture (you can still use TexturedMaaku as an example), or find another library that suits your needs better.
You can also try using CMDocument instead of Document, use the renderHtml method to get an html string, then create an NSAttributedString from that (but you won't have as much control over the styling and it might be slow).
I hope to look more into the table issue when I have time, but that may be a while.
The code is :
let markdownString = ""
Colons can be used to align columns.
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
The outer pipes (|) are optional, and you don't need to make the
raw Markdown line up prettily. You can also use inline Markdown.
""
var style = DefaultStyle()
let finalText = doc.attributedText(style: style)
sampleTextView.attributedText = finalText
Table view is not supported also new line after every item in an ordered/unordered list is not rendering at all, instead all are displayed as a single paragraph . Please help !
The text was updated successfully, but these errors were encountered: