Open Mek101 opened 2 years ago
Hello @Mek101 ,
you would need to use an edit handler for the image span. But it looks like an edit handler for image won't be possible because of current limitations. The same limitations are applied to tables and latex and come from the fact that they are not represented as text when displayed in a TextView.
So I would need some kind of custom spannable?
Well, it would be nessesary for a few things more.
)come from the fact that they are not represented as text when displayed in a TextView.
If markwon uses ImageSpan
, then couldn't it simply call getSource()
on it to retrieve the text from the span? I'm not sure if I understand the roadblock
I'm giving my try to a WYSIWYG Markdown editor. Following the mvvm architecture I decopulated the markdown renderer from the UI fragment and re-implemented part of
MarkwonEditorTextWatcher
to use Kotlin coroutines in order to render the markdown on a background thread; then following your original implementation, I send thePreRenderResult
back to the UI and update theTextView
with the following lambda:And since I use SAF, I implemented a custom scheme handler for android's
content
uirs:While the
Markwon
andMarkwonEditor
instances are built in the following manner:The problem is that in the end result no image is shown. Adding
Log.i()
to the various callbacks show that neither the error handler, the place holder provider or the scheme handler are ever called.The markdown I used to test:
I already added the internet permissions
Sorry If I've been a bit verbose but I'm not sure if using a different thread for rendering influences the image rendering or they also somehow depend on the rest of the library's architecture(?)