Skip to content

Commit

Permalink
V10: Find and persist embedded images in rich text (#14546)
Browse files Browse the repository at this point in the history
* add method to find and persist embedded base64 (data-uri) images in a html string

* use method to find embedded images in the Umbraco.TinyMce and Umbraco.Grid property editors

* rename method to better reflect what it does

* set allowed upload file types for integration tests

* add test for embedded images in Umbraco.TinyMce

* let old ctor call new ctor

* Apply suggestions from code review

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* apply pattern matching

---------

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
  • Loading branch information
iOvergaard and Zeegaan authored Jul 18, 2023
1 parent c12cce6 commit ab836d2
Show file tree
Hide file tree
Showing 5 changed files with 340 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ public GridPropertyValueEditor(

if (html is not null)
{
var parseAndSavedTempImages = _pastedImages.FindAndPersistPastedTempImages(html, mediaParentId, userId, _imageUrlGenerator);
var parseAndSaveBase64Images = _pastedImages.FindAndPersistEmbeddedImages(
html, mediaParentId, userId);
var parseAndSavedTempImages = _pastedImages.FindAndPersistPastedTempImages(parseAndSaveBase64Images, mediaParentId, userId);
var editorValueWithMediaUrlsRemoved = _imageSourceParser.RemoveImageSources(parseAndSavedTempImages);
rte.Value = editorValueWithMediaUrlsRemoved;
}
Expand Down
Loading

0 comments on commit ab836d2

Please sign in to comment.