@deep/nest-kit
    Preparing search index...

    Class RichTextService

    Index

    Constructors

    • Parameters

      • extensions: Extensions

      Returns RichTextService

    Properties

    dom: JSDOM
    schema: Schema

    Methods

    • Parameters

      • html: string

      Returns RichText

    • Parameters

      • plaintext: string

      Returns RichText

    • Returns Extensions

    • Returns Schema<any, any>

    • Merges two RichText objects into a single RichText object.

      This function combines the content of two RichText objects, with the "before" content appearing first, followed by the "after" content. It handles spacing between the texts intelligently to avoid duplicate spaces or missing spaces at the join point.

      Parameters

      • before: RichText

        The RichText object to appear first in the merged result

      • after: RichText

        The RichText object to appear second in the merged result

      Returns RichText

      A new RichText object containing the combined content

      Error if either input is not a valid RichText object

    • Splits a RichText object into two parts at the specified offset position.

      Parameters

      • richText: RichText

        The RichText object to split

      • offset: number

        The character position (0-based) at which to split the text

      Returns { after: RichText; before: RichText }

      Object with before and after RichText objects

    • Parameters

      • content: JSONContent

      Returns string

    • Parameters

      • content: JSONContent

      Returns string

    • Parameters

      • content: JSONContent

      Returns string

    • Parameters

      • tichText: RichText

      Returns string