Skip to content

Commit

Permalink
feat: Allow figcaption in HTML sanitizer display preloaded height and…
Browse files Browse the repository at this point in the history
… width in the image properties dialog - EXO-75213 - Meeds-io/MIPs154
  • Loading branch information
sofyenne committed Nov 19, 2024
1 parent 60fcadc commit 934d4cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ abstract public class HTMLSanitizer {
"exo-wiki-include-page",
"iframe")
.allowAttributes("page-name").onElements("exo-wiki-include-page")
.allowElements("figcaption")
.allowAttributes("class")
.matching(HTML_CLASS)
.onElements("figcaption")
//Allows the named elements for xwiki input
.allowElements("wikiimage","wikilink","wikimacro")
.allowAttributes("wikiparam")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,16 @@ CKEDITOR.dialog.add( 'image2', function( editor ) {

// Get the natural height of the image.
preLoadedHeight = domHeight = natural.height;

// set the preloaded values if no defined values
if (!widget?.data?.width) {
widget.setData( 'width', preLoadedWidth);
}

if (!widget?.data?.height) {
widget.setData( 'height', preLoadedHeight);
}

},
contents: [
{
Expand Down

0 comments on commit 934d4cf

Please sign in to comment.