<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Idowu olamide</title>
    <description>The latest articles on DEV Community by Idowu olamide (@justolaa).</description>
    <link>https://dev.to/justolaa</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F728396%2Fe6c7a31e-6c15-4c28-8528-5a3aec20de9a.jpg</url>
      <title>DEV Community: Idowu olamide</title>
      <link>https://dev.to/justolaa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/justolaa"/>
    <language>en</language>
    <item>
      <title>Building an AI Markdown Formatter for Web3 (and the Unexpected Problems I Faced)</title>
      <dc:creator>Idowu olamide</dc:creator>
      <pubDate>Sat, 14 Mar 2026 06:07:35 +0000</pubDate>
      <link>https://dev.to/justolaa/building-an-ai-markdown-formatter-for-web3-and-the-unexpected-problems-i-faced-djo</link>
      <guid>https://dev.to/justolaa/building-an-ai-markdown-formatter-for-web3-and-the-unexpected-problems-i-faced-djo</guid>
      <description>

&lt;p&gt;If you’ve ever tried to write a blog post with a complex layout—like side-by-side bilingual columns, perfectly aligned images, and custom dividers—you know that standard Markdown eventually hits a wall. &lt;/p&gt;

&lt;p&gt;Now, imagine trying to do that for a decentralized blockchain where your post will be rendered by completely different frontends, each with its own CSS rules and security sanitizers. &lt;/p&gt;

&lt;p&gt;That is the reality for content creators on the &lt;strong&gt;Hive Blockchain&lt;/strong&gt;. Writers spend hours wrestling with raw HTML just to make their articles look like professional magazines.&lt;/p&gt;

&lt;p&gt;I decided this process was broken. So, I built &lt;strong&gt;Hive Studio&lt;/strong&gt;: an intelligent, AI-powered formatting tool that takes raw, messy text and instantly restructures it into beautiful, cross-frontend compatible HTML.&lt;/p&gt;

&lt;p&gt;Here is the story of how I built it, the unexpected technical hurdles of parsing Markdown for Web3, and how I forced an AI to behave like a strict Layout Engine instead of a creative writer.&lt;/p&gt;




&lt;h2&gt;
  
  
  🐝 Understanding the Hive Ecosystem
&lt;/h2&gt;

&lt;p&gt;For those unfamiliar, Hive is a decentralized Web3 blogging platform. But unlike Medium or Hashnode, Hive isn't a single website. It is a blockchain. &lt;/p&gt;

&lt;p&gt;Different apps—like &lt;strong&gt;PeakD&lt;/strong&gt; and &lt;strong&gt;Ecency&lt;/strong&gt;—act as "frontends" that read the same blockchain data but render the UI using their own unique codebases. &lt;/p&gt;

&lt;p&gt;This creates a massive headache for developers and writers: &lt;strong&gt;Compatibility.&lt;/strong&gt; &lt;br&gt;
If you use modern CSS (like Flexbox or Grid) inline, these frontends will likely strip it out for security reasons. If your formatting works on PeakD, it might look entirely broken on Ecency.&lt;/p&gt;


&lt;h2&gt;
  
  
  💡 The Idea Behind Hive Studio
&lt;/h2&gt;

&lt;p&gt;The goal was simple: &lt;strong&gt;Let writers write, and let the app handle the code.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of forcing users to memorize complex HTML tags to create a dual-language post, I wanted a workflow that looked like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User pastes a wall of unformatted text.&lt;/li&gt;
&lt;li&gt;User selects a visual template (e.g., "Magazine Layout" or "Crypto Analyst").&lt;/li&gt;
&lt;li&gt;User clicks the &lt;strong&gt;"Magic Brush ✨"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The AI analyzes the text, injects the correct HTML structure, adds relevant divider images, and outputs perfect code ready for publishing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;My trip to the beach.
It was very sunny.
Mi viaje a la playa.
Hacía mucho sol.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;After (Hive Studio Output):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"magazine-template"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;center&amp;gt;&amp;lt;h2&amp;gt;&lt;/span&gt;✨ My Midnight Rhythms ✨&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;blockquote&amp;gt;&amp;lt;center&amp;gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-center text-muted"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This young man's unexpected awakening and urgent routine of the night&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/blockquote&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;center&amp;gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"lead"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;I was supposed to turn off the generator by 12pm but accidentally slept off. It's 12:40am, and I quickly rushed out to turn it off. I couldn't sleep after that event, so I decided to explore the midnight letters community.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&amp;lt;/center&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;hr&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"pull-left"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"35%"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://kgtwiouewpybiboywane.supabase.co/storage/v1/object/public/user-uploads/justola1/1771354747624.jpeg"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;So for me, midnight is the appropriate time for introspection, a bit of social media, and a few bullet chess games. Ever since I was a young boy, I had an attitude of reflecting on how I spent my day, and the best time I felt was right to do that was midnight, when everywhere is quiet and I can properly listen to my thoughts.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&amp;lt;br&lt;/span&gt; &lt;span class="na"&gt;clear=&lt;/span&gt;&lt;span class="s"&gt;"all"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;hr&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧗 The Hardest Technical Problems
&lt;/h2&gt;

&lt;p&gt;Building the UI in React was the easy part. The real challenge was building a parsing engine and an AI system that respected the strict rules of Hive frontends.&lt;/p&gt;
&lt;h3&gt;
  
  
  A. The "Modern CSS" Trap (Hive Compatibility)
&lt;/h3&gt;

&lt;p&gt;My initial instinct was to use modern inline styles to create layouts. For example, to prevent floating images from breaking the text flow, I injected &lt;code&gt;style="overflow: hidden; clear: both;"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result?&lt;/strong&gt; The Hive frontends immediately stripped the &lt;code&gt;style&lt;/code&gt; attribute. The layout collapsed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt; I had to become a frontend archaeologist. I inspected the DOM of both PeakD and Ecency and discovered they rely heavily on &lt;strong&gt;Bootstrap 4&lt;/strong&gt; utility classes. I had to abandon custom CSS and build my template engine entirely around legacy classes like &lt;code&gt;pull-left&lt;/code&gt;, &lt;code&gt;pull-right&lt;/code&gt;, &lt;code&gt;text-justify&lt;/code&gt;, and the classic &lt;code&gt;&amp;lt;br clear="all"&amp;gt;&lt;/code&gt; to guarantee 100% compatibility across all platforms.&lt;/p&gt;
&lt;h3&gt;
  
  
  B. Markdown Rendering Nightmares
&lt;/h3&gt;

&lt;p&gt;When you mix HTML and Markdown, parsers get very confused. &lt;br&gt;
For instance, users love centering images. But if you write this:&lt;br&gt;
&lt;code&gt;&amp;lt;center&amp;gt;![My Image](https://link.com/img.png)&amp;lt;/center&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Standard Markdown parsers often treat the inside as plain text because it's wrapped in a block-level HTML tag. Furthermore, I noticed that &lt;code&gt;**bold**&lt;/code&gt; syntax would sporadically fail inside certain nested &lt;code&gt;div&lt;/code&gt; structures on Hive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; I wrote a pre-processing Regex step in JavaScript to catch Markdown images inside &lt;code&gt;&amp;lt;center&amp;gt;&lt;/code&gt; tags and strictly convert them to HTML &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tags &lt;em&gt;before&lt;/em&gt; feeding them to &lt;code&gt;remark&lt;/code&gt;. I also instructed the AI to exclusively use &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;em&amp;gt;&lt;/code&gt; instead of asterisks.&lt;/p&gt;
&lt;h3&gt;
  
  
  C. Taming the AI (The "Content Integrity" Protocol)
&lt;/h3&gt;

&lt;p&gt;This was the hardest part. I integrated Google's &lt;strong&gt;Gemini 2.5 Flash Lite&lt;/strong&gt; to act as the "Magic Brush". &lt;/p&gt;

&lt;p&gt;At first, I told the AI: &lt;em&gt;"Format this chess tournament post."&lt;/em&gt;&lt;br&gt;
Instead of just adding HTML tags, the AI decided to &lt;em&gt;write a fictional summary of a chess match&lt;/em&gt;. Users complained that the AI was changing their personal stories and grammar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt; I had to treat the AI like a stubborn layout engine. I built a dynamic prompt architecture in my backend that injects specific formatting rules based on the user's chosen template, wrapped in a strict "Supreme Law":&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Inside my Supabase Edge Function (Deno)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`
  You are a Layout Engine. Your job is STRUCTURE, not writing.

  --- 🛡️ CONTENT INTEGRITY PROTOCOL (SUPREME LAW) ---
  1. DO NOT FIX GRAMMAR. Keep the text exactly as provided.
  2. DO NOT SUMMARIZE or add introductory fluff.
  3. PERMITTED EXTRACTION: You may copy headers to build a Table of Contents, or move data into a Markdown Table, but the WORDS MUST NOT CHANGE.

  --- SPECIFIC TEMPLATE RULES (&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;activeTemplate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;) ---
  &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;activeTemplate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ai_prompt_from_database&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;
`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;By storing the &lt;code&gt;ai_prompt&lt;/code&gt; in my database, I could dynamically instruct the AI to create "Zig-Zag" image layouts for Magazine templates, or "Data Tables" for Crypto templates, all without hardcoding it into the frontend.&lt;/p&gt;


&lt;h2&gt;
  
  
  🛠️ The Tech Stack
&lt;/h2&gt;

&lt;p&gt;To make this secure and highly performant, I utilized a modern T3-adjacent stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; React (Vite) + Tailwind CSS v4.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI/UX:&lt;/strong&gt; Custom "Creator Terminal" dark mode aesthetic using Lucide React icons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backend &amp;amp; Auth:&lt;/strong&gt; Supabase (PostgreSQL) to store dynamic template rules and custom user gallery uploads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI Integration:&lt;/strong&gt; Google Gemini API, securely hidden inside &lt;strong&gt;Supabase Edge Functions&lt;/strong&gt; (Deno) with IP-based rate limiting to prevent abuse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blockchain:&lt;/strong&gt; &lt;code&gt;@hiveio/keychain-sdk&lt;/code&gt; for secure, zero-fee direct publishing to the blockchain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosting:&lt;/strong&gt; Vercel.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🎥 The Result
&lt;/h2&gt;

&lt;p&gt;The final product allows a user to paste raw text, automatically style it with AI, manage their image assets, and publish directly to the blockchain without ever touching a line of code.&lt;/p&gt;

&lt;p&gt;

&lt;iframe class="tweet-embed" id="tweet-2032226106158297576-741" src="https://platform.twitter.com/embed/Tweet.html?id=2032226106158297576"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2032226106158297576-741');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2032226106158297576&amp;amp;theme=dark"
  }





&lt;/p&gt;
&lt;h3&gt;
  
  
  📺 Watch the Demo
&lt;/h3&gt;

&lt;p&gt;You can watch a full walkthrough of how Hive Studio works on YouTube:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;YouTube Video:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;


  &lt;iframe src="https://www.youtube.com/embed/KsK1s-rrhKg"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;
&lt;h3&gt;
  
  
  📝 Read the Original Hive Post
&lt;/h3&gt;

&lt;p&gt;You can read the original article introducing Hive Studio here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ecency Post:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;


&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://ecency.com/hive-139531/@justola1/yhhwaysbdz?referral=justola1" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;ecency.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;





&lt;h3&gt;
  
  
  🧵 Developer Thread
&lt;/h3&gt;

&lt;p&gt;I also shared a developer thread explaining some of the technical challenges here:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;X Thread:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;


&lt;iframe class="tweet-embed" id="tweet-2032226086981902351-507" src="https://platform.twitter.com/embed/Tweet.html?id=2032226086981902351"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2032226086981902351-507');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2032226086981902351&amp;amp;theme=dark"
  }





&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Don't fight the ecosystem:&lt;/strong&gt; If a platform uses Bootstrap 4, use Bootstrap 4. Forcing modern CSS into legacy sanitizers is a losing battle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI needs boundaries:&lt;/strong&gt; LLMs want to be creative. If you want them to act as deterministic parsers or formatters, you must use heavily constrained "Negative Prompts" (telling them exactly what &lt;em&gt;not&lt;/em&gt; to do).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security first:&lt;/strong&gt; Moving AI calls to serverless Edge Functions isn't just about hiding API keys; it allows you to implement critical rate-limiting before a malicious script drains your free-tier quota.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🚀 Future Improvements
&lt;/h2&gt;

&lt;p&gt;Hive Studio is already live, but I'm looking forward to adding:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multiple Drafts:&lt;/strong&gt; A full database-backed draft management system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Template Creator:&lt;/strong&gt; Allowing users to submit their own CSS layouts to the public gallery.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More Web3 Integrations:&lt;/strong&gt; Auto-fetching 3Speak video thumbnails via the Hive API (already partially implemented!).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  👋 Let's Connect
&lt;/h2&gt;

&lt;p&gt;You can try the live application here:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;&lt;a href="https://hivestudio.vercel.app" rel="noopener noreferrer"&gt;https://hivestudio.vercel.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check out the source code and contribute:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;&lt;a href="https://github.com/justolaa/Hive-Studio" rel="noopener noreferrer"&gt;https://github.com/justolaa/Hive-Studio&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you're interested in Web3, Markdown tooling, or developer productivity tools, I’d love to hear your thoughts in the comments. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;I am a Full-Stack React &amp;amp; AI Developer passionate about building intelligent interfaces and solving complex frontend challenges. If your team is looking to integrate AI or Web3 into your products, let's talk!&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>react</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
