Anyone who works regularly in Google Docs knows the pain:
You paste content from the web, a PDF, an email, or another document—and suddenly your bullets have weird spacing, broken formatting, or mystery blank lines that refuse to go away.
You try deleting them manually.
You try changing line spacing.
You even try Apps Script code others recommend…
But nothing works.
This is because many pasted lists in Google Docs don’t behave like normal bullet items. They contain:
- Hidden zero-width characters
- Mixed list formatting
- Ghost paragraphs
- Broken list-item nodes
- Interleaved
LIST_ITEMvsPARAGRAPHstructures
These invisible formatting artifacts cause Google Docs to insert stubborn empty lines between bullets that cannot be removed using normal delete or formatting tools.
After testing multiple approaches, the most reliable solution is:
⭐ Convert All Bullets to Dash (“-”) Lines Using a Safe Apps Script
Instead of trying to fix or remove the broken bullet structure, the simplest and most reliable fix is to:
- Detect every bullet (
LIST_ITEM) - Clone its visible text
- Insert a clean paragraph above it prefixed with
- - Remove the original list item
This bypasses the broken bullet formatting entirely.
Below is the final script that works 100% of the time, even when Google Docs uses invalid formatting internally.
✅ Google Apps Script: Convert Bullet Points Into Dash Lines
This script:
- Converts each bullet or numbered list item into a clean line beginning with
- - Removes any empty bullet items
- Eliminates all bullet formatting issues instantly
- Works even when Docs returns corrupted formatting structures
The Script
function convertBulletsToDashes() {
const doc = DocumentApp.getActiveDocument();
const body = doc.getBody();
const total = body.getNumChildren();
// Loop backwards to avoid index shifting when removing elements
for (let i = total - 1; i >= 0; i--) {
const el = body.getChild(i);
if (el.getType() !== DocumentApp.ElementType.LIST_ITEM) {
continue; // skip non-list items
}
const listItem = el.asListItem();
const text = listItem.getText().trim();
// If it's an empty list bullet → delete it
if (text === "") {
body.removeChild(listItem);
continue;
}
// Insert a new paragraph ABOVE the list item
const newPara = body.insertParagraph(i, "- " + text);
// Copy formatting (optional but recommended)
newPara.setAttributes(listItem.getAttributes());
// Delete the original list item
body.removeChild(listItem);
}
doc.saveAndClose();
}
🧠 How This Script Fixes the Problem
Google Docs often stores pasted bullets in inconsistent ways:
- Some are typed as real bullets (
LIST_ITEM) - Some become paragraphs pretending to be bullets
- Some contain invisible Unicode characters
- Some contain list styling without actual list semantics
Fixing them requires dealing with Google Docs’ unpredictable internal structure.
This script avoids the problem entirely:
✔ It removes the list item
✔ It inserts a clean paragraph
✔ It adds a simple dash prefix
✔ It copies any formatting you want to keep
✔ It deletes empty list nodes
The result is a clean, consistent list with no formatting gaps.
📌 When You Should Use This Script
Use this solution when:
- Pasted bullet lists have blank lines between items
- Bullet formatting can’t be removed
- Changing spacing doesn’t fix the gaps
- The list switches between bullets and paragraphs unpredictably
- You want clean text formatting instead of rich list formatting
- Docs refuses to collapse “empty” lines
This method is the most reliable fix available.
🚀 How to Use It
- Open your Google Doc
- Go to Extensions → Apps Script
- Paste the script into
Code.gs - Click Save
- Choose the function:
convertBulletsToDashes - Press Run
- Authorize the script
- Check your document—your broken bullets are now clean, dash-prefixed lines
🎉 Before & After Example
Before: (broken bullets with extra line spacing)
• A Drive Folder
• Its own RAG Index
• A name
• A selectable workspace dropdown
After running the script:
- A Drive Folder
- Its own RAG Index
- A name
- A selectable workspace dropdown
Perfect spacing. No blank lines. No bullet formatting issues.
