<?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: Tusing1</title>
    <description>The latest articles on DEV Community by Tusing1 (@tusing1).</description>
    <link>https://dev.to/tusing1</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4147374%2F40813ec9-bb1e-46d5-8a58-9867b6d77c79.png</url>
      <title>DEV Community: Tusing1</title>
      <link>https://dev.to/tusing1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tusing1"/>
    <language>en</language>
    <item>
      <title>How I Review AI-Generated HTML Before Publishing It</title>
      <dc:creator>Tusing1</dc:creator>
      <pubDate>Tue, 29 Sep 2026 03:58:09 +0000</pubDate>
      <link>https://dev.to/tusing1/how-i-review-ai-generated-html-before-publishing-it-128k</link>
      <guid>https://dev.to/tusing1/how-i-review-ai-generated-html-before-publishing-it-128k</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F448s6o2w10biqyd7o86f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F448s6o2w10biqyd7o86f.png" alt="HTML Online Viewer — useful private browser tools" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI can produce a complete-looking webpage in seconds. That speed is useful, but a page that &lt;em&gt;looks&lt;/em&gt; finished may still contain broken structure, inaccessible images, unsafe links or code you did not intend to run.&lt;/p&gt;

&lt;p&gt;I built &lt;a href="https://html-onlineviewer.com/" rel="noopener noreferrer"&gt;HTML Online Viewer&lt;/a&gt; because I wanted a quick way to inspect HTML and see its result side by side. While adding an AI Coding Lab to the project, I turned my own review routine into the checklist below. This article was written with AI assistance and then edited, verified and tested by me.&lt;/p&gt;

&lt;p&gt;The goal is not to distrust every generated line. It is to make review small enough that you will actually do it.&lt;/p&gt;

&lt;h2&gt;
  
  
  A deliberately imperfect example
&lt;/h2&gt;

&lt;p&gt;Here is a short page containing three problems that are easy to miss when scanning a larger AI response:&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="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Community Health Day&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Community Health Day&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Free health checks at the town hall.&lt;span class="nt"&gt;&amp;lt;p&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;"health-team.jpg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"javascript:alert('Hello')"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Reserve a place&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The page may still render, but it is not ready to publish:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The paragraph has another opening &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; where its closing &lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt; should be.&lt;/li&gt;
&lt;li&gt;The image has no &lt;code&gt;alt&lt;/code&gt; description.&lt;/li&gt;
&lt;li&gt;The link executes JavaScript instead of navigating to a clear destination.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 1: keep the first preview isolated
&lt;/h2&gt;

&lt;p&gt;Do not paste unfamiliar HTML into an important production page first. Open it in a separate preview whose frame is sandboxed. This limits what the preview can do to the surrounding application.&lt;/p&gt;

&lt;p&gt;A sandbox is a safety boundary, not a guarantee. If the code depends on third-party scripts, forms, logins or private data, read those parts before enabling them. Never paste passwords, API keys or customer information into code you did not fully review.&lt;/p&gt;

&lt;p&gt;In HTML Online Viewer, paste the document into the editor and use the live preview. The tool runs the preview in an isolated frame and keeps ordinary editing in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: check document structure before styling
&lt;/h2&gt;

&lt;p&gt;Start at the top and confirm the page has the essential document pieces:&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="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;A useful, specific page title&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="c"&gt;&amp;lt;!-- Visible page content --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then follow opening and closing tags. Indentation helps reveal whether an element closes in the place you expect. A formatter is useful here, but do not assume that formatting has repaired the meaning of the document.&lt;/p&gt;

&lt;p&gt;For the broken example, change:&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;p&amp;gt;&lt;/span&gt;Free health checks at the town hall.&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to:&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;p&amp;gt;&lt;/span&gt;Free health checks at the town hall.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: inspect every URL and executable section
&lt;/h2&gt;

&lt;p&gt;Search for these strings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script
javascript:
onclick=
onerror=
iframe
form
fetch(
localStorage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;None is automatically malicious. Each one simply deserves an explanation.&lt;/p&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which domain does this script, image, form or frame contact?&lt;/li&gt;
&lt;li&gt;Does a click run code that the visible label does not explain?&lt;/li&gt;
&lt;li&gt;Does the page read or store information?&lt;/li&gt;
&lt;li&gt;Would the feature still work with the third-party code removed?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Replace the example’s JavaScript link with a real route:&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;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/reserve"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Reserve a place&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there is no reservation page yet, use an ordinary button only when JavaScript will provide a clearly defined action. Do not leave a link that pretends to navigate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: perform a keyboard and meaning check
&lt;/h2&gt;

&lt;p&gt;AI-generated pages often favour visual appearance over semantics. Before judging colours or spacing, check the reading structure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There should normally be one clear &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; for the page.&lt;/li&gt;
&lt;li&gt;Heading levels should describe sections, not merely create large text.&lt;/li&gt;
&lt;li&gt;Interactive actions should use links or buttons, not clickable &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; elements.&lt;/li&gt;
&lt;li&gt;Form controls need visible labels.&lt;/li&gt;
&lt;li&gt;Images need useful &lt;code&gt;alt&lt;/code&gt; text when they communicate meaning.&lt;/li&gt;
&lt;li&gt;Decorative images should use &lt;code&gt;alt=""&lt;/code&gt; so a screen reader can skip them.&lt;/li&gt;
&lt;li&gt;Focus should remain visible when you move with the Tab key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For the example, add an alternative description that conveys the image’s purpose:&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;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"health-team.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Nurses welcoming visitors at a community health event"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then use only the keyboard to move through every control. Confirm that focus order matches the visual order and that every action can be reached and understood.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: test narrow screens, missing assets and long content
&lt;/h2&gt;

&lt;p&gt;A polished desktop preview is not enough. Check at least:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a narrow phone width;&lt;/li&gt;
&lt;li&gt;a tablet width;&lt;/li&gt;
&lt;li&gt;a wide desktop width;&lt;/li&gt;
&lt;li&gt;200% browser zoom;&lt;/li&gt;
&lt;li&gt;a deliberately long heading;&lt;/li&gt;
&lt;li&gt;an unavailable image;&lt;/li&gt;
&lt;li&gt;a slow or blocked external resource.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Look for horizontal scrolling, clipped buttons, overlapping text and controls that become too small to tap. The browser console may also reveal a missing image or script that the visible design hides.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: validate behaviour, not just appearance
&lt;/h2&gt;

&lt;p&gt;Open every link. Submit every form with valid and invalid input. Trigger empty states. Reload the page. If a feature stores data, explain where that data goes and test what happens when storage is unavailable.&lt;/p&gt;

&lt;p&gt;For generated JavaScript, read the code path that runs &lt;em&gt;before&lt;/em&gt; you press the button. A pleasant label such as “Generate report” does not tell you whether the code downloads a file, sends data to a service or both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7: make one controlled fix at a time
&lt;/h2&gt;

&lt;p&gt;Large AI rewrites can solve one problem while introducing another. Prefer a short loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Describe one observable problem.&lt;/li&gt;
&lt;li&gt;Change the smallest relevant section.&lt;/li&gt;
&lt;li&gt;Preview again.&lt;/li&gt;
&lt;li&gt;Repeat the same keyboard, mobile and error checks.&lt;/li&gt;
&lt;li&gt;Save a working version before the next change.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The corrected example becomes:&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="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Community Health Day&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Community Health Day&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Free health checks at the town hall.&lt;span class="nt"&gt;&amp;lt;/p&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;"health-team.jpg"&lt;/span&gt;
        &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Nurses welcoming visitors at a community health event"&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/reserve"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Reserve a place&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  My pre-publish checklist
&lt;/h2&gt;

&lt;p&gt;I use this short list before an AI-assisted page leaves a preview:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] I understand every external URL and script.&lt;/li&gt;
&lt;li&gt;[ ] The document has a doctype, language, charset, viewport and useful title.&lt;/li&gt;
&lt;li&gt;[ ] Opening and closing tags match.&lt;/li&gt;
&lt;li&gt;[ ] The heading order communicates the page structure.&lt;/li&gt;
&lt;li&gt;[ ] Images have appropriate alternative text.&lt;/li&gt;
&lt;li&gt;[ ] Links and buttons describe what they do.&lt;/li&gt;
&lt;li&gt;[ ] Keyboard focus reaches every interactive control.&lt;/li&gt;
&lt;li&gt;[ ] Phone, tablet, desktop and zoom layouts do not overflow.&lt;/li&gt;
&lt;li&gt;[ ] Empty, invalid and missing-asset states make sense.&lt;/li&gt;
&lt;li&gt;[ ] No secrets or private data are embedded in the source.&lt;/li&gt;
&lt;li&gt;[ ] I tested the final version after the last change.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What this workflow cannot prove
&lt;/h2&gt;

&lt;p&gt;A browser preview and syntax check cannot guarantee that a page is secure, accessible or correct. Server code, dependencies, authentication, payment flows, data handling and organisation-specific policies need their own review. Automated accessibility tools also miss problems that only a person completing the real task will notice.&lt;/p&gt;

&lt;p&gt;Use the checklist as a strong first review—not as a substitute for appropriate security, accessibility or domain expertise.&lt;/p&gt;

&lt;p&gt;If you want a browser workspace for the steps above, use the &lt;a href="https://html-onlineviewer.com/" rel="noopener noreferrer"&gt;HTML editor and live preview&lt;/a&gt; or follow the longer canonical guide, &lt;a href="https://html-onlineviewer.com/guides/ai-coding/preview-ai-generated-html-safely" rel="noopener noreferrer"&gt;Preview AI-generated HTML safely&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What is the most surprising mistake you have found in generated frontend code?&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
