CircuitVerse / mobile-app

Mobile App for CircuitVerse
https://play.google.com/store/apps/details?id=org.circuitverse.mobile_app
MIT License
73 stars 94 forks source link

Interactive book throwing error , markdown builder bug fixed #237 #249

Closed tanmoysrt closed 1 year ago

tanmoysrt commented 1 year ago

Fixes

@tachyons
This issue is an reference to the bug in issue #216

I have go through the codes, and debugged the code.
I found the issue is actually in markdown library which is used by flutter_markdown. The bug is that if there is any inline element (image, some special widget.) at the end of markdown , sometimes it cant group it with adjacent child nodes of AST. and the MarkdownBuilder throw error .

To prevent the issue in this app, I am adding an special invisibie character to the end of markdown. So that if there is any inline element left behind , it can group with the invisible text. We cant use the space, as during the parsing process the right and left whitespaces trimmed.

That invisibile character is between the bracket. -> (‎ ) Unicode value -> U+200e

I have tested all the parts of interactive book. It has no issue now.

Describe the changes you have made in this PR -

In ./lib/ui/views/ib/ib_page_view.dart I have update the content before send it to markdown builder, like below

content = content  + invisible character

Screenshots of the changes (If any) -

The issue was found in Interactive Book > Sequential SSI > Clock Signals page. I am attaching an image of that now.

But I have checked all the pages of Interactive book, And no issue found. Everything rendering perfectly .

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

tanmoysrt commented 1 year ago

@manjotsidhu can you take a look

manjotsidhu commented 1 year ago

@Tanmoy741127 Does the PR of https://github.com/CircuitVerse/packages/pull/39 sufficient enough to fix this issue ? Does this PR also needs to be merged ?

tanmoysrt commented 1 year ago

@Tanmoy741127 Does the PR of CircuitVerse/packages#39 sufficient enough to fix this issue ? Does this PR also needs to be merged ?

PR of CircuitVerse/packages#39 is sufficient to fix the issue. You can close this current PR #249 , it's not required anymore.