The text content to display
Container element with text content, or null if text is empty
// Default: div containing paragraph
const summary = createTextContainer({
text: 'This is a summary of the article content.'
});
// Result: <div><p>This is a summary...</p></div>
// Direct text without nested element
const directText = createTextContainer({
text: 'Direct text content',
textTag: null
});
// Result: <div>Direct text content</div>
// Custom container and text tags
const article = createTextContainer({
text: 'Article content',
containerTag: 'article',
textTag: 'div'
});
// Result: <article><div>Article content</div></article>
// With HTML content (use carefully)
const richText = createTextContainer({
text: '<strong>Bold</strong> text',
allowHTML: true
});
Creates a text container element with optional nested text element
Creates a wrapper element (div by default) optionally containing a nested text element (paragraph by default). Useful for creating structured text blocks like summaries, descriptions, or content blocks.