Closed dgwaldo closed 3 years ago
That looks pretty good. The inefficiency is there, but I guess that's the result of not accounting for images in the core way of doing replacements. But it shouldn't really be an issue unless you're doing a lot of image replacement.
The important part is that it works. I went ahead and tested for nested images. Didn't spend much time figuring out how to verify that the image is actually replaced, but at least visually - it works.
Thank you very much for contributing!
I tried to fit this within the framework of how the rest of your component replacers work. It has a bit of an inefficiency in that it converts from a stream to base64 then out of base64 back to a string.
I haven't tested it on anything nested. I'm assuming based on how the rest of your stuff work it'll just work. Added one test that runs the code. I didn't take the time to figure out how to correctly assert that the PictureContentControl had been filled. Check out the test, and take a look at the result. Perhaps you will see a better way it could be done?
Also, apologize for moving the curlys, my VS settings get me when working on open source.