Skip to content
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

Latex preview does not work on Android and #81

Closed
EquinoxM opened this issue Feb 1, 2023 · 7 comments
Closed

Latex preview does not work on Android and #81

EquinoxM opened this issue Feb 1, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@EquinoxM
Copy link

EquinoxM commented Feb 1, 2023

Describe the bug
I think it is interfering with the Markdown inline hidden text feature referring to Hiding content with comments

To Reproduce
just downloaded the example and ran it then everything seems fine

Expected behavior
Images/video/latex should be visible and show up

Screenshots
image

Platform
Does the problem appear on the Web or on the Mobile
yes both

@EquinoxM EquinoxM added the bug Something isn't working label Feb 1, 2023
@EquinoxM
Copy link
Author

EquinoxM commented Feb 1, 2023

additional info since I saw that the project is using Gradle 6.7 and my project is using 7.6

@thomastthai
Copy link

The cited items work on web, Windows, and Android with the changes detailed in:

  • To get the demo to work with Gradle 7.6, check out Issue #79.
  • See Issue #80 about the video.

@EquinoxM
Copy link
Author

EquinoxM commented Feb 1, 2023

when running it on my phone after double checking and redoing everything like 5 times I got these errors and video still not working
I also added the permission from the [email protected] page and still didn't play
and got this error which I think is related to the images not loading and not the video

E/FlutterJNI(26293): Failed to decode image
E/FlutterJNI(26293): android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error.
E/FlutterJNI(26293): 	at android.graphics.ImageDecoder.nCreate(Native Method)
E/FlutterJNI(26293): 	at android.graphics.ImageDecoder.access$200(ImageDecoder.java:173)
E/FlutterJNI(26293): 	at android.graphics.ImageDecoder$ByteBufferSource.createImageDecoder(ImageDecoder.java:250)
E/FlutterJNI(26293): 	at android.graphics.ImageDecoder.decodeBitmapImpl(ImageDecoder.java:1847)
E/FlutterJNI(26293): 	at android.graphics.ImageDecoder.decodeBitmap(ImageDecoder.java:1840)
E/FlutterJNI(26293): 	at io.flutter.embedding.engine.FlutterJNI.decodeImage(FlutterJNI.java:524)

I think it has to be something related to what I said in the first message that markdown is recognizing it first and flagging it as ignore in the out or something because anything I put in between <> disappears no matter what unless I do <\ > and in that case it just displays it as a normal text

I was able to display an image using html inspect then copy element it worked using this ctrl+c ctrl+v
and was able to get images/gifs from google drive as well as from any where on the internet

<img src="https://drive.google.com/uc?export=view&id=1JmjnyfuFPTp6BEWtUfPtpebCir0yGiVW"> 

several tries later and still can't get a video to show up but any images can now

one more note it seems like renaming images from .svg to .png works fine would love to find something for the videos and latex as well I was more interested in latex than video and got images along the way

@EquinoxM
Copy link
Author

EquinoxM commented Feb 2, 2023

UPDATE

after many trails later I found the solution
got the idea from issue #77 about using the dev version of the widget and everything just worked fine and went to try out the master branch to make sure I wasn't doing anything wrong and it didn't work
I was using markdown_widget: ^2.0.0+1 in my pubspec.yaml
and changing it to

markdown_widget:
    git:
      url: https://github.com/asjqkkkk/markdown_widget.git
      ref: dev

solved all the issues
I haven't tried with a clean project without all the modifications from @thomastthai suggestion

I will leave this issue open just incase someone comes looking for an answer

@EquinoxM
Copy link
Author

EquinoxM commented Feb 2, 2023

here is an update screen shot since I forgot to post one with a few notices
for images .svg doesn't work you need a .png image instead for it to work
and for latex equations I can't find a solution to them exceeding the screen width rn
flutter_02

@asjqkkkk
Copy link
Owner

asjqkkkk commented Feb 3, 2023

Hi @EquinoxM , thanks for your issue
there are some problems with custom html tags, I'll try to improve them at next version,
and there will be more examples for how to use a custom tag, such as Latex

@asjqkkkk
Copy link
Owner

Hi, v2.1.0 has been published, and there are more latex samples with online demo : https://asjqkkkk.github.io/markdown_widget/#/sample_latex

you can have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants