AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How Content Teams and Publishers Export Lex Drafts to Google Docs, WordPress, and Markdown Without Losing Formatting

최지향 · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Lex offers one of the cleanest, fastest drafting experiences available for modern writers. Built on top of the ProseMirror framework and polished with Tiptap, its minimalist interface lets editorial teams harness generative AI without drowning in the clutter of traditional word processors. But drafting is only the first mile. The moment a finished manuscript leaves Lex and heads toward Google Docs for stakeholder review, WordPress Gutenberg for web production, or a headless CMS for Markdown rendering, publishing pipelines frequently run into trouble.

Headings degrade into unstyled paragraphs. Inline links snap. Custom CSS styles bleed into CMS themes, creating phantom margins. Most dangerous of all, images uploaded directly into Lex stay tethered to Lex’s remote Amazon S3 storage buckets, leaving live publications vulnerable to broken media if remote tokens expire.

At 365Finds, our commercial research across digital media operations shows that editorial teams lose between fifteen and thirty minutes per article fixing formatting rot caused by naive copy-pasting. That friction is entirely preventable. Here is why the export pipeline breaks, how Lex’s underlying document model behaves, and the exact protocols content teams need to export Lex drafts to Google Docs, WordPress, and raw Markdown with zero formatting loss.


The Underlying Engine: Why Lex Drafts Break on Export

To prevent formatting loss, you have to understand what Lex actually produces when you write.

Unlike traditional word processors that store documents in rigid binary containers, Lex manages text as an in-memory document tree powered by ProseMirror. When you type Markdown shortcuts—such as # for a top-level heading, > for a blockquote, or - for a bullet list—Lex instantly parses those tokens into semantic ProseMirror schema nodes.

When an editor presses Cmd+C or Ctrl+C to copy a draft out of the Lex web canvas, the operating system clipboard receives two distinct payloads:

  1. Plain text (text/plain): Raw unformatted characters, stripping all headings, hyperlinks, and layout hierarchy.
  2. Rich HTML (text/html): A serialized HTML tree containing semantic tags (<h1>, <h2>, <p>, <a>, <blockquote>) wrapped inside inline styling attributes (font-family, font-size, line-height, letter-spacing) generated by Lex’s browser styling layer.

The breakdown occurs because external publishing systems interpret that serialized HTML payload very differently:

Destination SystemPrimary Input MechanismWhere Formatting BreaksThe Root Cause
Google DocsDirect Paste / Markdown ImportHeading styles clash; inline comments vanishDocs applies local typography overrides; Docs comments live in a proprietary Google layer
WordPress (Gutenberg)HTML Block Paste / Markdown PasteDouble H1 penalties; dirty inline CSS; hotlinked imagesPasting rich HTML injects inline font styles; Lex CDN images are hotlinked instead of uploaded
Headless CMS / GhostRaw Markdown File UploadMissing YAML frontmatter; absolute S3 image pathsLex exports standard CommonMark without CMS metadata headers

At 365Finds, our firm position is clear: Never perform a naive "Select All, Copy, Paste" from the Lex web interface directly into a production CMS. It compromises content hygiene. The clean path requires treating Markdown and semantic HTML as deliberate pipeline stages.


Pipeline 1: Migrating Lex Drafts to Google Docs for Stakeholder Review

Digital agencies and publishing houses routinely use Lex for initial drafting and AI-assisted rewriting, but client review, legal approval, and stakeholder sign-off almost always occur in Google Docs.

Moving text between Lex and Google Docs without scrambling heading hierarchy or typography requires following one of two validated approaches.

Method A: The Native Markdown Import (Recommended by 365Finds)

Google Docs now provides native Markdown import and export capabilities. This bypasses clipboard HTML formatting issues entirely.

  1. In Lex, open your completed draft.
  2. Click the document menu in the top-right corner and select Export > Markdown (.md).
  3. Open Google Drive, click New > File upload, and upload the exported .md file.
  4. Right-click the uploaded file in Google Drive and select Open with > Google Docs.
  5. Google Docs automatically converts # headings into native Google Docs "Heading 1", ## into "Heading 2", and blockquotes into native indented callouts.

This method guarantees that your document inherits your corporate Google Docs styling template (your brand font, spacing, and color palette) rather than carrying over leftover web font artifacts from Lex.

Method B: The Clipboard Route (Fastest for Internal Teams)

If you must copy and paste directly across open browser tabs:

  1. In Google Docs, navigate to Tools > Preferences.
  2. Check the box labeled Automatically detect Markdown and ensure Markdown paste handling is enabled.
  3. In Lex, click Export > Copy as Markdown (or highlight the text if exporting a partial snippet).
  4. In Google Docs, paste the content using standard Cmd+V / Ctrl+V. Docs will parse the Markdown syntax into formatted text blocks.
  5. Watch the Title Trap: Lex places the document title above the editing canvas. If you select all text, Google Docs often tags the document title as an unstyled paragraph or a duplicate "Heading 1". Manually format the first line as "Title" in Docs, and verify that the first major subhead begins at "Heading 2".

Crucial Editorial Note on Comments: Lex’s built-in collaborative commenting and AI tracking markers do not export to Google Docs via clipboard or Markdown. If your team requires editorial tracking across multiple reviewers, conclude AI drafting in Lex first, complete the export, and conduct the review stage exclusively within Google Docs.


Pipeline 2: Delivering to WordPress Gutenberg Without Formatting Rot

Publishing a Lex draft to WordPress Gutenberg is where most media teams introduce technical debt. Pasting rich HTML from Lex directly into Gutenberg often wraps paragraphs in unwanted inline <span> tags, distorts column margins, and creates duplicate H1 tags that undermine search engine optimization.

Here is the four-step protocol 365Finds recommends for a zero-loss WordPress workflow.

[ Lex Draft ]
      │
      ▼  (Export as Markdown)
[ Clean .md Output ]
      │
      ├─► Step 1: Strip Document Title (Prevent Dual H1s)
      ├─► Step 2: Ingest into Gutenberg via Markdown Block Parsing
      ├─► Step 3: Localize Remote S3 Images into WP Media Library
      └─► Step 4: Validate Code & Quote Blocks
      │
      ▼
[ Live WordPress Post ]

Step 1: Separate the Post Title from Body Copy

WordPress themes reserve the native Post Title field for the primary <h1> tag. In Lex, writers frequently include the title at the top of the body copy as an <h1>.

If you paste both into Gutenberg, your published page will contain two <h1> tags. This confuses search engine indexers and creates inconsistent header typography. Always cut the Lex title and paste it strictly into the Gutenberg post header field (Add title), starting your body block paste with the first section paragraph or <h2>.

Step 2: Use Gutenberg’s Markdown Block Parser

Instead of pasting rich HTML:

  1. In Lex, select Export > Copy as Markdown (or open the exported .md file).
  2. Open a blank post in WordPress Gutenberg.
  3. Click inside the empty default paragraph block and press Cmd+V / Ctrl+V.
  4. Gutenberg’s native block parser will automatically detect the Markdown headers (##, ###), lists (-, 1.), and blockquotes (>), converting each element into its dedicated WordPress core block (core/heading, core/list, core/quote).

Because you pasted raw Markdown rather than serialized HTML, Gutenberg generates clean, semantic markup devoid of hardcoded inline CSS attributes.

Step 3: Localize Remote Lex Images (The S3 Media Trap)

When you insert an image into Lex, the platform uploads the asset to an AWS S3 bucket. A Markdown export represents this as:

![Chart description](https://lex-inc-media.s3.us-west-2.amazonaws.com/uploads/xyz-image.png)

If you leave this URL inside WordPress:

The Fix: In Gutenberg, click on any image block referencing an external Lex URL. Click the Upload to Media Library button that appears in the block toolbar. WordPress will pull the image from Lex’s S3 bucket, store it in your local wp-content/uploads directory, and rewrite the block reference automatically.


Pipeline 3: Exporting to Headless CMS and Static Site Generators (Ghost, Astro, GitHub)

For digital publishers running Ghost, Jekyll, Astro, Hugo, or documentation hosted on GitHub, Markdown is the native currency. Lex is an excellent drafting front-end for these environments, but it lacks CMS metadata.

Lex’s native .md export outputs clean CommonMark, but static site generators require YAML frontmatter at the head of every file.

Required Publishing Structure

When Lex generates a .md export, content teams must prepend structured frontmatter before pushing to production:

---
title: "How Content Teams and Publishers Export Lex Drafts Without Losing Formatting"
date: 2026-11-08
slug: "lex-export-formatting-guide"
author: "365Finds Editorial Research"
tags: ["Publishing Workflow", "Lex", "CMS Integration"]
description: "A complete guide to migrating drafts from Lex to Google Docs, WordPress, and Markdown."
---

## Why Direct Copy-Pasting Breaks Your Content Pipeline
Your body copy begins directly with an H2 subhead...

Automated Pipeline: The 365Finds Zero-Loss Python Script

For high-volume publishing teams that export dozens of Lex drafts weekly, manual cleanups waste valuable editorial hours. 365Finds has developed a lightweight Python utility that automates three core tasks:

  1. Strips the duplicated title and converts the first heading level correctly.
  2. Scans for remote Lex S3 image URLs, downloads them locally, and updates image references.
  3. Prepends standard YAML frontmatter for instant CMS deployment.
import os
import re
import urllib.request

def sanitize_lex_export(md_filepath, output_dir, post_slug):
    os.makedirs(os.path.join(output_dir, "images"), exist_ok=True)
    
    with open(md_filepath, "r", encoding="utf-8") as f:
        content = f.read()

    # 1. Extract first H1 as title, then remove it from body to prevent double H1
    title_match = re.search(r"^#\s+(.+)$", content, re.MULTILINE)
    title = title_match.group(1) if title_match else post_slug.replace("-", " ").title()
    body = re.sub(r"^#\s+.+\n+", "", content, count=1)

    # 2. Find and localize Lex S3 image links
    lex_img_pattern = r'!\[(.*?)\]\((https://lex-inc-media\.s3\.[^)]+)\)'
    
    def download_and_replace(match):
        alt_text = match.group(1)
        url = match.group(2)
        filename = f"{post_slug}-{os.path.basename(url.split('?')[0])}"
        local_path = os.path.join(output_dir, "images", filename)
        
        try:
            urllib.request.urlretrieve(url, local_path)
            return f'![{alt_text}](/images/{filename})'
        except Exception:
            return match.group(0) # Keep original if download fails

    sanitized_body = re.sub(lex_img_pattern, download_and_replace, body)

    # 3. Assemble final CMS-ready document with YAML frontmatter
    frontmatter = (
        f"---\n"
        f"title: \"{title}\"\n"
        f"slug: \"{post_slug}\"\n"
        f"status: \"draft\"\n"
        f"---\n\n"
    )

    final_output = frontmatter + sanitized_body
    output_path = os.path.join(output_dir, f"{post_slug}.md")
    
    with open(output_path, "w", encoding="utf-8") as f:
        f.write(final_output)

    print(f"Sanitized file successfully generated at: {output_path}")

# Example invocation for newsroom editorial desks:
# sanitize_lex_export("lex-raw-draft.md", "./published", "lex-export-guide")

The 365Finds Institutional Evaluation: The Four Golden Rules

At 365Finds, we believe Lex’s ProseMirror engine represents the pinnacle of distraction-free, AI-assisted manuscript generation. However, confusing an authoring sandbox with a publishing CMS is where digital newsrooms stumble.

To maintain immaculate content hygiene across your multi-channel publishing stack, enforce these four golden rules across your editorial team:

  1. Default to Markdown Export, Not Clipboard HTML: Exporting .md strips the invisible typography spans that corrupt Gutenberg blocks and Google Docs line spacing.
  2. Quarantine the Document Title: Never paste the Lex H1 into your CMS body editor. Input it exclusively into your CMS post title field.
  3. Never Publish Hotlinked Lex S3 Images: Ingest all media into your CMS media library or self-hosted CDN to protect your publication against upstream URL rot.
  4. Isolate Collaboration Phases: Complete AI generation and initial line editing in Lex, but conduct multi-stakeholder legal and client reviews inside Google Docs, as Lex comment metadata cannot cross the export boundary.

Following these principles transforms what used to be a frustrating formatting chore into a reliable, automated editorial workflow.

References