diff --git a/modules/tide_ckeditor/modules/ckeditor_tablecol_resize/src/Plugin/Filter/FilterResizeTableColumns.php b/modules/tide_ckeditor/modules/ckeditor_tablecol_resize/src/Plugin/Filter/FilterResizeTableColumns.php index 8d1ef0ae..43b41cb2 100644 --- a/modules/tide_ckeditor/modules/ckeditor_tablecol_resize/src/Plugin/Filter/FilterResizeTableColumns.php +++ b/modules/tide_ckeditor/modules/ckeditor_tablecol_resize/src/Plugin/Filter/FilterResizeTableColumns.php @@ -4,9 +4,7 @@ use Drupal\ckeditor5\Plugin\CKEditor5PluginManagerInterface; use Drupal\Component\Utility\Html; -use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\Core\Routing\CurrentRouteMatch; use Drupal\filter\FilterProcessResult; use Drupal\filter\Plugin\FilterBase; use Psr\Container\ContainerInterface; @@ -24,6 +22,11 @@ */ class FilterResizeTableColumns extends FilterBase implements ContainerFactoryPluginInterface { + /** + * The CKEditor5 plugin manager. + * + * @var \Drupal\ckeditor5\Plugin\CKEditor5PluginManagerInterface + */ protected CKEditor5PluginManagerInterface $ckeditor5PluginManager; /** diff --git a/modules/tide_ckeditor/tide_ckeditor.install b/modules/tide_ckeditor/tide_ckeditor.install index 47bcde62..1a43afbd 100644 --- a/modules/tide_ckeditor/tide_ckeditor.install +++ b/modules/tide_ckeditor/tide_ckeditor.install @@ -47,16 +47,17 @@ function tide_ckeditor_update_10002() { if ($filter) { // Add , , and to allowed HTML. $additional_allowed_tags = ' '; - // Append the new tags to the allowed HTML, making sure not to add duplicates + // Append the new tags to the allowed HTML, + // making sure not to add duplicates. $replaced = $allowed_html . ' ' . $additional_allowed_tags; $replaced = trim($replaced, ','); - // Set the updated allowed HTML tags in the filter + // Set the updated allowed HTML tags in the filter. $filter->set('filters.filter_html.settings.allowed_html', $replaced); $filter->set('filters.filter_resize_tablecolumns', [ 'id' => 'filter_resize_tablecolumns', 'provider' => 'ckeditor_tablecol_resize', - 'status' => true, + 'status' => TRUE, 'weight' => 99, 'settings' => [], ]); diff --git a/modules/tide_landing_page/src/Plugin/jsonapi/FieldEnhancer/BasicTextEnhancer.php b/modules/tide_landing_page/src/Plugin/jsonapi/FieldEnhancer/BasicTextEnhancer.php index b3cf7b5b..bd165bf6 100644 --- a/modules/tide_landing_page/src/Plugin/jsonapi/FieldEnhancer/BasicTextEnhancer.php +++ b/modules/tide_landing_page/src/Plugin/jsonapi/FieldEnhancer/BasicTextEnhancer.php @@ -83,6 +83,9 @@ public function replaceUnicodeWhitespace(array $data) { return $data; } + /** + * Helper function to add table styles to processed field. + */ public function addTableStylesToProcessed(&$data) { // Check if 'value' and 'processed' keys exist in $data. if (isset($data['value']) && isset($data['processed'])) { @@ -91,7 +94,7 @@ public function addTableStylesToProcessed(&$data) { $processedDom = new \DOMDocument(); // Suppress warnings for malformed HTML in $value and $processed. - libxml_use_internal_errors(true); + libxml_use_internal_errors(TRUE); $valueDom->loadHTML($data['value']); $processedDom->loadHTML($data['processed']); libxml_clear_errors(); @@ -117,14 +120,14 @@ public function addTableStylesToProcessed(&$data) { $processedCol = $processedCols->item($j); if ($valueCol->hasAttribute('style')) { - // Parse the style attribute. + // Parse the style attribute. $styleValue = $valueCol->getAttribute('style'); $styles = explode(';', $styleValue); foreach ($styles as $style) { $style = trim($style); if (!empty($style)) { - list($property, $value) = explode(':', $style, 2); + [$property, $value] = explode(':', $style, 2); $property = trim($property); $value = trim($value); @@ -149,4 +152,5 @@ public function addTableStylesToProcessed(&$data) { } return $data; } + }