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
Throws
Error if either input is not a valid RichText object
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.