-
Notifications
You must be signed in to change notification settings - Fork 43
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
Asset URL Replacement Enhancement #398
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good! Url replacement strategy is future base url change resistant as well
@pokornyd What is status on this? |
hello and thank you for the PR submission. while this implementation is valid, it only covers standalone asset elements. for assets used in rich text, you'd need to implement additional handling at I would also refactor the replacement function to parse the original asset url as URI and append feel free to extend the PR to cover rich text elements as well, otherwise, I'll look into the matter myself, though I can't promise a release until new year |
I'll see if I can figure out the RichTextResolver piece you mentioned. In regards to the URI route, I did a quick performance test and it appears that the string version I proposed is about 2.74x faster then the URI approach. So not sure if you still want to do it that way? Here is the benchmark program: PerfTestUrlReplacement.zip BenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5131/22H2/2022Update)
|
@pokornyd I updated the rich text content converter as well. It appears that it only is used when you try to embed images into rich text blocks. Let me know if I missed anything. I left the string replacement version in place for now until you can review the performance question above. |
@pokornyd Any update? |
hello Xantari, thanks for the additional input. please accept my apologies regarding the delayed replies, I had to prioritize work on other repositories and didn't get a chance to review your proposed changes yet. I'll put this on top of my to-do list and get back to you asap, thanks for your patience. |
The performance gain is still in the realm of nanoseconds, so I would say that it's negligible in this scenario and prefer readability over minimal performance gain. Feel free to commit the URI version and I'll review the remaining code in the meantime. As for the rich text image support, I think it's a valid scenario, as images in rich text element are commonplace and would benefit from the custom asset domain support as well. |
6b13c44
to
7da097b
Compare
Motivation
Which issue does this fix? Fixes #311, #193, and #397
If no issue exists, what is the fix or new feature? Were there any reasons to fix/implement things that are not obvious?
Checklist
How to test
If manual testing is required, what are the steps?
N/A