From 1980b8d30596d331283e06ca9ee3cb406bdd826b Mon Sep 17 00:00:00 2001
From: Joakim tags issue that was causing invalid HTML
Key improvements:
- Elements like now maintain all attributes
- Markdown **bold**, *italic*, [links](url) inject as inline formatted content
- Database content type (markdown/text/link) overrides parser auto-detection
- Clean HTML output without structural corruption
Before: **bold**
**bold text**
(clean) Server remains source of truth for markdown processing with zero runtime overhead. --- demo-site/about.html | 242 +++++++++++++++++------------------ demo-site/index.html | 144 +++++++++++---------- internal/content/enhancer.go | 16 ++- internal/content/injector.go | 7 +- internal/content/markdown.go | 17 ++- 5 files changed, 222 insertions(+), 204 deletions(-) diff --git a/demo-site/about.html b/demo-site/about.html index 88af869..3ec8475 100644 --- a/demo-site/about.html +++ b/demo-site/about.html @@ -1,136 +1,136 @@ - - -We're a team of experienced consultants dedicated to helping small businesses thrive in today's competitive marketplace.
-We're a team of experienced consultants dedicated to helping small businesses thrive in today's competitive marketplace.
+Founded in 2020, Acme Consulting emerged from a simple observation: small businesses needed access to the same high-quality strategic advice that large corporations receive, but in a format that was accessible, affordable, and actionable.
- -Our founders, with combined experience of over 30 years in business strategy, operations, and technology, recognized that the traditional consulting model wasn't serving the needs of growing businesses. We set out to change that.
- -Today, we've helped over **200 businesses** streamline their operations, clarify their strategy, and achieve sustainable growth. Our approach combines proven methodologies with a deep understanding of the unique challenges facing small to medium-sized businesses.
-Founded in 2020, Acme Consulting emerged from a simple observation: small businesses needed access to the same high-quality strategic advice that large corporations receive, but in a format that was accessible, affordable, and actionable.
+ +Our founders, with combined experience of over 30 years in business strategy, operations, and technology, recognized that the traditional consulting model wasn't serving the needs of growing businesses. We set out to change that.
+ +Today, we've helped over **200 businesses** streamline their operations, clarify their strategy, and achieve sustainable growth. Our approach combines proven methodologies with a deep understanding of the unique challenges facing small to medium-sized businesses.
+We're a diverse group of strategists, operators, and technology experts united by our passion for helping businesses succeed.
- -Founder & CEO
-Former McKinsey consultant with 15 years of experience in strategy and operations. MBA from Stanford.
-Head of Operations
-20 years in manufacturing and supply chain optimization. Expert in lean methodologies and process improvement.
-Digital Strategy Lead
-Former tech startup founder turned consultant. Specializes in digital transformation and technology adoption.
-We're a diverse group of strategists, operators, and technology experts united by our passion for helping businesses succeed.
+ +Founder & CEO
+Former McKinsey consultant with 15 years of experience in strategy and operations. MBA from Stanford.
+Head of Operations
+20 years in manufacturing and supply chain optimization. Expert in lean methodologies and process improvement.
+Digital Strategy Lead
+Former tech startup founder turned consultant. Specializes in digital transformation and technology adoption.
+Every recommendation we make is designed with your specific business context and goals in mind.
-We believe in strategies that you can actually implement with your current resources and capabilities.
-We're not just consultants; we're partners in your business success for the long haul.
-Every recommendation we make is designed with your specific business context and goals in mind.
+We believe in strategies that you can actually implement with your current resources and capabilities.
+We're not just consultants; we're partners in your business success for the long haul.
+This paragraph should be individually editable with a textarea.
-This second paragraph should also be individually editable.
-Each paragraph should get its own modal when clicked.
-This paragraph is part of a group.
-Clicking anywhere should open one markdown editor with rich formatting.
-All content should be editable together as markdown with proper HTML conversion.
-This paragraph should be individually editable with a textarea.
+This second paragraph should also be individually editable.
+Each paragraph should get its own modal when clicked.
+This paragraph is part of a group.
+Clicking anywhere should open one markdown editor with rich formatting.
+All content should be editable together as markdown with proper HTML conversion.
+We help small businesses **grow** through strategic planning, process optimization, and digital transformation. Our team brings 15+ years of experience to drive your success.
- Get Started Today -We help small businesses grow through strategic planning, process optimization, and digital transformation. Our team brings 15+ years of experience to drive your success. Superb
+ + Get Started Today? +Comprehensive solutions tailored to your business needs
- -Develop clear roadmaps and actionable strategies that align with your business goals and drive sustainable growth.
-Streamline processes, reduce costs, and improve efficiency through proven methodologies and best practices.
-Modernize your technology stack and digital presence to compete effectively in today's marketplace.
-Comprehensive solutions tailored to your business needs
+ +Develop clear roadmaps and actionable strategies that align with your business goals and drive sustainable growth.
+Streamline processes, reduce costs, and improve efficiency through proven methodologies and best practices.
+Modernize your technology stack and digital presence to compete effectively in today's marketplace.
+--"Acme Consulting transformed our operations completely. We saw a 40% increase in efficiency within 6 months of implementing their recommendations."
- Sarah Johnson, CEO of TechStart Inc. -
++"Acme Consulting transformed our operations completely. We saw a 40% increase in efficiency within 6 months of implementing their recommendations."
+ Sarah Johnson, CEO of TechStart Inc. +
Contact us today for a free consultation and discover how we can help you achieve your goals.
- Schedule Consultation -Contact us today for a free consultation and discover how we can help you achieve your goals.
+ Schedule Consultation +and
tags if the content is wrapped in a single paragraph - if len(html) > 7 && html[:3] == "" && html[len(html)-4:] == "
" { - html = html[3 : len(html)-4] + // Clean up goldmark's paragraph wrapping for inline content + // If content is wrapped in a singletag, extract just the inner content + html = strings.TrimSpace(html) + + if strings.HasPrefix(html, "
") && strings.HasSuffix(html, "
") { + // Check if this is a single paragraph (no othertags inside) + inner := html[3 : len(html)-4] // Remove
and
+ if !strings.Contains(inner, "") { + // Single paragraph - return just the inner content for inline injection + return inner, nil + } } + // Multiple paragraphs or other block content - return as-is return html, nil }