Skip to content

Instantly share code, notes, and snippets.

View polwex's full-sized avatar

~polwex polwex

  • Singapore
View GitHub Profile
@polwex
polwex / chatgpt-conversation-exporter.js
Created June 5, 2026 07:50 — forked from LukasMFR/chatgpt-conversation-exporter.js
JavaScript snippet to export a ChatGPT conversation from the web UI to a clean Markdown file, with correct user/assistant attribution, code block preservation, and basic media placeholders. Designed to be run directly in the browser console (Safari/Chrome/Firefox).
(() => {
function formatDate(date = new Date()) {
return date.toISOString().split("T")[0];
}
function escapeMarkdown(text) {
return text
.replace(/\\/g, "\\\\")
.replace(/\*/g, "\\*")
.replace(/_/g, "\\_")