CoreMedia CKEditor 5 Plugins
    Preparing search index...

    Processing rule for transforming a color style represented in HTML (by color style) to [color=#ff0000]Text[/color] in BBCode.

    Due to the behavior of CSSStyleDeclaration color formats such as rgb(), rgba() or hsl() are supported as well and will all be transformed to hex or hex-alpha representation.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    id: "color"

    Some ID solely used for debugging purpose. Recommended to keep unique among rules, though.

    tags: string[] = ...

    BBCode tags, this rule is related to. Automatically also registers tags as known to BBCode to HTML processing.

    Typically, you list tags here, which are generated during toData mapping.

    Methods

    • Transforms an element or parts of it to BBCode. Typical rules will apply mapping according to the element type, name or one of its attributes.

      It is recommended to clean any consumed attribute values, to signal that they got processed.

      Parameters

      • element: HTMLElement

        element to transform

      • content: string

        the current BBCode

      Returns string | undefined

      the new BBCode to continue with; undefined to continue with BBCode as is.