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

Handle unsupported attributes in Markdown conversion + horizontal lines #418

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

maelchiotti
Copy link
Contributor

@maelchiotti maelchiotti commented Sep 2, 2024

fixes #405

@amantoux
Copy link
Member

amantoux commented Sep 4, 2024

Thank you @maelchiotti, will take a look as soon as I find some time
In the meanwhile, can you ensure the CI is green? You seem to have some issues with the linter

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 87.97%. Comparing base (b98743a) to head (1612a92).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
packages/parchment/lib/src/codecs/markdown.dart 50.00% 10 Missing ⚠️
packages/fleather/lib/src/widgets/theme.dart 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #418      +/-   ##
==========================================
+ Coverage   87.94%   87.97%   +0.02%     
==========================================
  Files          62       62              
  Lines       10364    10443      +79     
==========================================
+ Hits         9115     9187      +72     
- Misses       1249     1256       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@amantoux amantoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @maelchiotti for this PR and very sorry for the late review
See my comments inline
More generally, you seem to tackle only the decoding part, did you intentionally ignore the encoding?
Also, we had mentioned the replacement of unsupported embeds with [object]
Lastly, can you prove this works with some tests please and remove the localization file from the PR?
Thanks!

Copy link
Member

@amantoux amantoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maelchiotti let me know if you want me to contribute to your PR

@maelchiotti
Copy link
Contributor Author

Thanks, I'll take a look at your review in a week or two, work on the encoding part that is missing, and I'll let you know where I could use some help!

@maelchiotti
Copy link
Contributor Author

maelchiotti commented Oct 13, 2024

@amantoux I made the changes you requested in the comments, and added the [object] replacement.

I did not handle the decoding part (you mixed up encoding and decoding in your comment btw) because I couldn't really understand how it works. Feel free to do it yourself and I'll read your code to see how you did it.

I've also added a very simple test for the encoding, let me know if you think I should write more to cover more cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could the markdown conversion convert unsupported attributes to plain text insead of throwing an error?
2 participants