-
-
Notifications
You must be signed in to change notification settings - Fork 875
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
Handled relative path in image URLs: #146
Conversation
- added prefixNetworkImageRelativePath in ImageProperties. - HtmlRichTextParser: prefixed node.attributes['src'] with imageProperties.prefixNetworkImageRelativePath
I think you should implement this feature also for the deprecated HtmlOldParser. |
But |
Oh sorry you're right. Forgott that |
New option: shrinkToFit
Version 0.11.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added my review. Just a couple small things and then we should be good to go!
lib/image_properties.dart
Outdated
@@ -30,5 +31,6 @@ class ImageProperties { | |||
this.centerSlice, | |||
this.matchTextDirection = false, | |||
this.filterQuality = FilterQuality.low, | |||
this.prefixNetworkImageRelativePath = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an assert
to the constructor that ensures that this is never null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor ImageProperties
is const
, so it cannot have a body.
- added interpolation to prepend image source with prefixImagePath
- added prefixNetworkImageRelativePath in ImageProperties. - HtmlRichTextParser: prefixed node.attributes['src'] with imageProperties.prefixNetworkImageRelativePath
- added interpolation to prepend image source with prefixImagePath
Do you mind squashing your commits so this is a bit easier to review? |
I dont think this is what flutter html should handle. |
Hi there, thanks for this PR! It looks like this code applies to the old parser and thus is incompatible with the latest changes on the branch. As a result, we may close this PR. |
…ender API Fixes Sub6Resources#153 and closes Sub6Resources#146
See #532 for an example on how to use relative paths with the new custom image render API. |
Many web content has relative images paths, which cannot be resolved in flutter_html.
Hence, I have made few changes as below:
prefixNetworkImageRelativePath
inImageProperties
.HtmlRichTextParser
: prefixednode.attributes['src']
withimageProperties.prefixNetworkImageRelativePath