Legacy Knowledge Base
公開されました Jun. 30, 2025

フラグメントのリッチ テキスト エディターでテキスト スタイルを変更すると、既に選択されているテキストの色が上書きされる

Written By

Balázs Létai

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • コンテンツ ページでリッチ テキスト エディターを使用してフラグメント (段落など) を編集し、以前に色付け/書式設定されたテキスト セクションのテキスト スタイルを変更すると、色が失われます。

  • 例:
    テキストのフォーマットを変更します。たとえば、色を Danger に設定します。

    Screenshot_2022-12-05_at_14.19.25.png

    テキストが赤くなるのがわかります。

    Screenshot_2022-12-05_at_14.20.37.png
    次に、テキストのスタイルを変更します。

    Screenshot_2022-12-05_at_14.20.18.png

    テキストに見出し 3 のスタイルが適用されますが、以前に設定した赤色が失われていることがわかります。

    Screenshot_2022-12-05_at_14.20.56.png

Environment

  • Liferay DXP 7.2+

解決策

  • テキストの書式設定は、フラグメントのリッチ テキスト エディターで選択したスタイルによって上書きされます。
  • CKeditor または AlloyEditor (CKeditor のコア コードの上に構築されている) を使用する場合、選択したテキストのスタイルを変更すると、常に段落全体に適用され、既に選択されている形式 (上記の例ではテキストの色) が上書きされます。
  • ユーザーが最初に目的のスタイルを選択し、そのスタイルの適用後にテキストの書式設定を開始した場合でも、エディターはすべての変更を保持します。 例えば 上記の例を使用して、ユーザーが最初に見出し 3 を選択してから色を変更すると、スタイルとフォーマット/色の両方の変更が選択したテキストに適用されます。

Did this article resolve your issue ?

Legacy Knowledge Base