Skip to content

Commit

Permalink
Merge pull request #165 from GSA/feature/DIGITAL-96-ckeditor-emoji
Browse files Browse the repository at this point in the history
DIGITAL-96: Implement Support Emojis
  • Loading branch information
mattsqd authored Feb 4, 2025
2 parents c9848bd + f09c402 commit 4906bdc
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 5 deletions.
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"drupal/auto_heading_ids": "^2.0@beta",
"drupal/autocomplete_deluxe": "^2.1",
"drupal/autologout": "^2.0",
"drupal/ckeditor_emoji": "^2.0",
"drupal/config_ignore": "^3.3",
"drupal/config_pages": "^2.16",
"drupal/config_split": "^2.0",
Expand Down Expand Up @@ -75,6 +76,7 @@
"drupal/views_bulk_operations": "^4.3",
"drupal/xmlsitemap": "^1.5",
"drush/drush": "^12.5",
"elvanto/litemoji": "^5.1",
"league/commonmark": "^2.5",
"mattsqd/drupal-env": "dev-main",
"mattsqd/drupal-env-lando": "dev-main",
Expand Down
98 changes: 94 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions composer.log
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ cd50d2b2b036edaa3a002881cf1b50ce|Ray Estrada|feature/DIGITAL-283-security-module
406c28be9e70355b9cfbbe1df58bb7ef|Ray Estrada|feature/DIGITAL-283-security-modules|Mon Jan 13 12:16:28 EST 2025|./composer.sh require drupal/database_ssl_check
699e8eda61efbe69e1f9a75fe81a3bf4|Oscar Merida|feature/DIGITAL-299-auto-headings|Tue Jan 14 14:23:14 EST 2025|./composer.sh require drupal/auto_heading_ids:^2.0@beta
c4f5d0dc96584bd1dc808fd112b6e516|Ray Estrada|feature/DIGITAL-252-community-review|Thu Jan 16 10:51:08 EST 2025|./composer.sh require drupal/svg_image
ce36fc2d9e87105d1ab7eda27ea9d434|Oscar Merida|develop|Mon Feb 3 14:30:03 EST 2025|./composer.sh require drupal/ckeditor_emoji
b2b17cbb32ac57e73928af9f52acb537|Oscar Merida|feature/DIGITAL-96-ckeditor-emoji|Mon Feb 3 15:14:17 EST 2025|./composer.sh require elvanto/litemoji
1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module:
block: 0
breakpoint: 0
ckeditor5: 0
ckeditor_emoji: 0
config_ignore: 0
config_pages: 0
config_split: 0
Expand Down
1 change: 1 addition & 0 deletions config/sync/editor.editor.html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ settings:
- drupalMedia
- sourceEditing
- embeddedContent__default
- Emoji
- style
plugins:
ckeditor5_heading:
Expand Down
5 changes: 4 additions & 1 deletion web/modules/custom/convert_text/src/ConvertText.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Drupal\convert_text;

use League\CommonMark\CommonMarkConverter;
use LitEmoji\LitEmoji;

/**
* Provides methods to convert migrated text for fields.
Expand Down Expand Up @@ -33,8 +34,10 @@ protected static function convert(string $source_text, string $field_type): stri
return html_entity_decode($source_text, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, 'UTF-8');

case 'html':

$converter = new CommonMarkConverter();
return $converter->convert($source_text)->getContent();
$html = $converter->convert($source_text)->getContent();
return LitEmoji::encodeUnicode($html);

default:
throw new \Exception("Invalid \$field_type of $field_type given");
Expand Down

0 comments on commit 4906bdc

Please sign in to comment.