-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to extract image from text input that is saved? #72
Comments
You would have to parse the HTML yourself using the Let me know if you need more help! |
Hi If you could explain further, maybe with an example it would be a great help. Thank you |
Sure no problem, I will post one this evening. |
Sorry for getting back to you so late. Something like this could work: import 'package:html/parser.dart' as htmlparser;
String html = "<h1>Title</h1><p>some stuff we don't want</p><img src='image_src'/>";
var parsed = htmlparser.parse(html);
var title = parsed.getElementsByTagName("h1")[0];
var image = parsed.getElementsByTagName("img")[0];
//don't know if this works, I haven't tested this behavior yet
String partialHtml = title.toString() + image.toString(); If that last line doesn't work then maybe |
Closing for now. Feel free to update here if the above answer doesn't work! |
I have saved text input using the toolbar in an ios app. If I want to return certain parts of the saved text, like the title and first image that I have saved. How can I achieve this?
Thanks
The text was updated successfully, but these errors were encountered: