Skip to content

Commit b092c50

Browse files
Merge branch 'develop' into feature/3526953-ckeditor-figure
2 parents 69fc06f + b0b9835 commit b092c50

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

web/themes/contrib/civictheme/config/install/editor.editor.civictheme_rich_text.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ settings:
7373
- '<h5 id>'
7474
- '<h6 id>'
7575
- '<drupal-media title>'
76+
- '<figure class data-component-id>'
77+
- '<div class>'
78+
- '<iframe width height src title allowfullscreen>'
7679
ckeditor5_style:
7780
styles:
7881
-

web/themes/contrib/civictheme/config/install/filter.format.civictheme_rich_text.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ filters:
4141
status: true
4242
weight: -50
4343
settings:
44-
allowed_html: '<br> <p class="ct-text-large ct-text-small text-align-left text-align-center text-align-right"> <h2 id class> <h3 id class="text-align-left text-align-center text-align-right"> <h4 id class="text-align-left text-align-center text-align-right"> <h5 id class="text-align-left text-align-center text-align-right"> <h6 id class="text-align-left text-align-center text-align-right"> <a class="ct-button ct-theme-light ct-button--primary ct-button--regular ct-button--secondary ct-button--large ct-content-link ct-content-link--external ct-button--button ct-theme-dark" hreflang target title href data-entity-type data-entity-uuid data-entity-substitution> <table class="ct-theme-light ct-table ct-table--striped"> <cite> <dl> <dt> <dd> <img src alt data-entity-type data-entity-uuid> <drupal-entity alt title data-entity-type data-entity-uuid data-entity-embed-display data-entity-embed-display-settings data-align data-caption data-embed-button> <span class="ct-visually-hidden"> <svg role viewbox aria-hidden width height class="ct-icon"> <path d> <blockquote cite> <ul type> <ol type start> <drupal-media title data-entity-type data-entity-uuid alt data-caption data-align> <strong> <em> <u> <s> <sub> <sup> <li> <tr> <td rowspan colspan> <th rowspan colspan> <thead> <tbody> <tfoot> <caption>'
44+
allowed_html: '<br> <p class="ct-text-large ct-text-small text-align-left text-align-center text-align-right"> <h2 id class> <h3 id class="text-align-left text-align-center text-align-right"> <h4 id class="text-align-left text-align-center text-align-right"> <h5 id class="text-align-left text-align-center text-align-right"> <h6 id class="text-align-left text-align-center text-align-right"> <a class="ct-button ct-theme-light ct-button--primary ct-button--regular ct-button--secondary ct-button--large ct-content-link ct-content-link--external ct-button--button ct-theme-dark" hreflang target title href data-entity-type data-entity-uuid data-entity-substitution> <table class="ct-theme-light ct-table ct-table--striped"> <cite> <dl> <dt> <dd> <img src alt data-entity-type data-entity-uuid> <drupal-entity alt title data-entity-type data-entity-uuid data-entity-embed-display data-entity-embed-display-settings data-align data-caption data-embed-button> <span class="ct-visually-hidden"> <svg role viewbox aria-hidden width height class="ct-icon"> <path d> <blockquote cite> <ul type> <ol type start> <drupal-media title data-entity-type data-entity-uuid alt data-caption data-align> <figure class data-component-id> <div class> <iframe width height src title allowfullscreen> <strong> <em> <u> <s> <sub> <sup> <li> <tr> <td rowspan colspan> <th rowspan colspan> <thead> <tbody> <tfoot> <caption>'
4545
filter_html_help: true
4646
filter_html_nofollow: false
4747
filter_html_escape:
@@ -76,6 +76,7 @@ filters:
7676
weight: 0
7777
settings:
7878
title: true
79+
media_substitution: metadata
7980
media_embed:
8081
id: media_embed
8182
provider: media

web/themes/contrib/civictheme/includes/link.inc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
declare(strict_types=1);
99

1010
use Drupal\Component\Utility\Html;
11-
use Drupal\filter\FilterPluginCollection;
1211

1312
/**
1413
* Process HTML content to replace URLs with links.
@@ -23,12 +22,14 @@ function _civictheme_process_html_content_urls_to_links(string $html): string {
2322
return $html;
2423
}
2524

26-
// Convert URLs to links using core filter_url.
27-
$filter_manager = \Drupal::service('plugin.manager.filter');
28-
$filter_collection = new FilterPluginCollection($filter_manager, []);
29-
$filter = $filter_collection->get('filter_url');
25+
// Use Drupal's text format processing system.
26+
$build = [
27+
'#type' => 'processed_text',
28+
'#text' => $html,
29+
'#format' => 'civictheme_rich_text',
30+
];
3031

31-
return _filter_url($html, $filter);
32+
return (string) \Drupal::service('renderer')->render($build);
3233
}
3334

3435
/**

0 commit comments

Comments
 (0)