Enhance HTMLContentRenderer and ToggleTableRow for improved content handling and metadata display
- Updated HTMLContentRenderer to directly utilize HTML from content objects. - Modified ToggleTableRow to extract and display content metadata, including primary and secondary keywords, tags, categories, and meta descriptions. - Refactored badge rendering logic for better organization and clarity in the UI. - Improved content fallback mechanisms in the Content page for better user experience.
This commit is contained in:
@@ -17,7 +17,15 @@ interface HTMLContentRendererProps {
|
||||
*/
|
||||
function formatContentOutline(content: any): string {
|
||||
if (!content) return '';
|
||||
|
||||
|
||||
// If object contains a `content` field with HTML, use that directly
|
||||
if (typeof content === 'object' && content !== null && 'content' in content) {
|
||||
const mainContent = (content as any).content;
|
||||
if (typeof mainContent === 'string' && mainContent.trim().length > 0) {
|
||||
return sanitizeHTML(mainContent);
|
||||
}
|
||||
}
|
||||
|
||||
let html = '<div class="content-outline">';
|
||||
|
||||
// Handle introduction section - can be object or string
|
||||
|
||||
Reference in New Issue
Block a user