feat: enable markdown processing for span elements
Backend changes: - Updated parser to treat <span> elements as markdown by default - Changed span content type detection from ContentText to ContentMarkdown - Spans now support **bold**, *italic*, and [links](url) formatting Frontend changes: - Updated content type detection to match backend behavior - Frontend now treats spans as markdown elements for consistent processing - Editor preview behavior now matches server-side enhancement Benefits: - <span class='highlight'>**bold** text</span> now processes markdown correctly - Inline elements maintain all styling while supporting rich formatting - Complete frontend/backend consistency for span element handling - Expands markdown support to common inline wrapper elements Tested and verified: - Span elements preserve all classes, IDs, and styles - Bold, italic, and link formatting works in span elements - Content type properly detected as 'markdown' in both systems
This commit is contained in:
@@ -23,8 +23,7 @@
|
|||||||
<section class="hero">
|
<section class="hero">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1 class="insertr" data-content-id="hero-title-7cfeea" data-content-type="text">Transform Your Business with Expert Consulting</h1>
|
<h1 class="insertr" data-content-id="hero-title-7cfeea" data-content-type="text">Transform Your Business with Expert Consulting</h1>
|
||||||
<p class="lead insertr" data-content-id="footer-text-d73f32" data-content-type="markdown"><p>We help small businesses <strong>grow</strong> through strategic planning, process optimization, and digital transformation. Our team brings 15+ years of experience to drive your success. Superb</p>
|
<p class="lead insertr" data-content-id="footer-text-d73f32" data-content-type="markdown"><strong>We</strong> help small businesses grow through strategic planning, process optimization, and digital transformation. Our team brings 15+ years of experience to drive your success. Superb</p>
|
||||||
</p>
|
|
||||||
<a href="contact.html" class="btn-primary insertr" data-content-id="link-d11ae9" data-content-type="link">Get Started Today?</a>
|
<a href="contact.html" class="btn-primary insertr" data-content-id="link-d11ae9" data-content-type="link">Get Started Today?</a>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -75,8 +74,7 @@
|
|||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="insertr" data-content-id="footer-text-a2b6a8-22fbf8" data-content-type="markdown">© 2024 Acme Consulting Services. All rights reserved.</p>
|
<p class="insertr" data-content-id="footer-text-a2b6a8-22fbf8" data-content-type="markdown">© 2024 Acme Consulting Services. All rights reserved.</p>
|
||||||
<p class="insertr" data-content-id="footer-text-d73f32" data-content-type="markdown"><p>We help small businesses <strong>grow</strong> through strategic planning, process optimization, and digital transformation. Our team brings 15+ years of experience to drive your success. Superb</p>
|
<p class="insertr" data-content-id="footer-text-d73f32" data-content-type="markdown"><strong>We</strong> help small businesses grow through strategic planning, process optimization, and digital transformation. Our team brings 15+ years of experience to drive your success. Superb</p>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,8 @@ func (p *Parser) detectContentType(node *html.Node, classes []string) ContentTyp
|
|||||||
// Default divs/sections to markdown for rich content
|
// Default divs/sections to markdown for rich content
|
||||||
return ContentMarkdown
|
return ContentMarkdown
|
||||||
case "span":
|
case "span":
|
||||||
return ContentText
|
// Default spans to markdown for rich inline content
|
||||||
|
return ContentMarkdown
|
||||||
default:
|
default:
|
||||||
return ContentText
|
return ContentText
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -339,6 +339,8 @@ export class InsertrCore {
|
|||||||
return 'link';
|
return 'link';
|
||||||
case 'div': case 'section':
|
case 'div': case 'section':
|
||||||
return 'markdown';
|
return 'markdown';
|
||||||
|
case 'span':
|
||||||
|
return 'markdown'; // Match backend: spans support inline markdown
|
||||||
default:
|
default:
|
||||||
return 'text';
|
return 'text';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user