[MGNLUI-7595] Document how to enable search for special characters in content stored by richTextField Created: 03/Nov/22  Updated: 14/Mar/23  Resolved: 07/Mar/23

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.25
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Adrian Brooks
Resolution: Done Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Relates
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLUI-7898 DOC: draft Documentation Task Completed Adrian Brooks  
MGNLUI-7899 DOC: rv, publish Documentation Task Completed Adrian Brooks  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[X]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: [JCR] Search Performance issues
Sprint: Nucleus 31
Story Points: 1
Team: Nucleus
Work Started:

 Description   

Steps to reproduce

  1.  Add content with special characters using a Richtext field, for example using TextImage component (example: boîte à lettres)
  2.  Search using the find bar

Expected results

Content is found as it happen with TextFields.

Actual results

Content is not found

Workaround

Development notes

It's how the ckeditor works. It encodes the data. If I use the textImage component from mtk2 you can see the difference between a basic text field and a rich text field. Notice the headline vs the text field in this export.

'0':
  'constrainAspectRatio': false
  'headline': 'boîte à lettres'
  'headlineLevel': 'small'
  'imagePosition': 'below'
  'jcr:primaryType': 'mgnl:component'
  'jcr:uuid': '1066710e-519f-42fb-8bf0-0c98f8f2864c'
  'mgnl:created': 2022-10-30T09:30:49.143Z
  'mgnl:createdBy': 'superuser'
  'mgnl:lastModified': 2022-10-30T09:30:49.143Z
  'mgnl:lastModifiedBy': 'superuser'
  'mgnl:template': 'travel-demo:components/textImage'
  'text': '<p>bo&icirc;te &agrave; lettres</p>'

Here you can find information about CKEditor HTML output format.



 Comments   
Comment by Roman Kovařík [ 03/Nov/22 ]

https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-entities_latin might do the trick (that would probably require a custom configJsFile)

Comment by Antonín Juran [ 27/Feb/23 ]

Discovery

Richtext field uses default CKEditor configuration which converts some Latin characters (Latin alphabet No. 1, ISO 8859-1) to HTML entities. The conversion can be disabled by configuring config.entities_latin = false; in the custom configJsFile as mentioned in rkovarik's comment.

We can also introduce a boolean entitiesLatin property in RichTextFieldDefinition and implement its initialisation on the default CKEditor config in RichTextFieldFactory#initializeCKEditorConfig method.

Generated at Mon Feb 12 09:47:34 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.