Skip to content

Commit

Permalink
#4203 - Remove empty tags from html content
Browse files Browse the repository at this point in the history
  • Loading branch information
romanlesnikov committed Jan 11, 2023
1 parent f2275af commit 87fd5e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inc/js/editor.quill.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ function bx_editor_init(oEditor, oParams){
var oConfig = {
theme: oParams.skin,
modules: {
clipboard: {
matchVisual: false
},
syntax: true,
imageResize: {},
toolbar: oParams.toolbar,
Expand Down
3 changes: 3 additions & 0 deletions inc/utils.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ function bx_process_output ($mixedData, $iDataType = BX_DATA_TEXT, $mixedParams

case BX_DATA_HTML:
$s = bx_linkify_html($mixedData, 'class="' . BX_DOL_LINK_CLASS . '"');

// remove empty tags from html content https://github.com/unaio/una/issues/4203
$s = preg_replace("/(((<\w+>)+[ \n(<br>)]*(<\/\w+>)+)+)|<br>/", '', $s);
return $mixedParams && is_array($mixedParams) && in_array('no_process_macro', $mixedParams) ? $s : bx_process_macros($s);
case BX_DATA_TEXT_MULTILINE:
$s = $mixedData;
Expand Down

0 comments on commit 87fd5e1

Please sign in to comment.