Simple browser extension to convert Markdown files to respective teletype.in blocks
  • JavaScript 98.8%
  • Makefile 1.2%
Find a file
2026-05-03 07:04:10 +08:00
examples finalize 2026-05-03 06:40:30 +08:00
.gitignore finalize 2026-05-03 06:40:30 +08:00
content.js finalize 2026-05-03 06:40:30 +08:00
interceptor.js added file import support; added embed support; added image upload support 2026-05-03 06:10:56 +08:00
LICENSE Add license 2026-05-03 07:04:10 +08:00
Makefile finalize #2 2026-05-03 06:53:49 +08:00
manifest.json finalize 2026-05-03 06:40:30 +08:00
README.md finalize 2026-05-03 06:40:30 +08:00

MD to Teletype

Chrome extension that imports Markdown into a Teletype draft.

Usage

  1. Open a Teletype draft editor (teletype.in/@<username>/editor/<uri>)
  2. Wait a moment for the page to finish loading (the extension captures your auth token from the page's early requests)
  3. Click the ↓ MD button (bottom-right corner)
  4. Choose a .md file or paste Markdown directly, then click Import
  5. Reload the page to see the result

Images

Use standard Markdown image syntax — images must be on their own line:

![Caption text](https://example.com/photo.jpg)

Remote URLs are fetched and re-uploaded to Teletype's CDN automatically. No extra steps needed.

Local files (images sitting next to your .md on disk) cannot be accessed by the browser directly. Reference them by any path — only the filename matters:

![Caption text](screenshot.png)
![Caption text](./screenshot.png)
![Caption text](./assets/img/screenshot.png)

Then click Choose images… in the import modal and select those files alongside the .md. The extension matches uploaded files by filename, ignoring any path prefix, and uploads them to Teletype's CDN.

Installation

Build

make          # produces build/md_to_teletype.zip
make clean    # removes build/

Chrome

chrome://extensions → enable Developer modeLoad unpacked (select the repo root), or drag-drop the zip.

Firefox

about:debuggingThis FirefoxLoad Temporary Add-on → pick manifest.json.

Files

File Purpose
manifest.json MV3 manifest; declares two content scripts on teletype.in/@*/editor/*
interceptor.js Runs at document_start in MAIN world; wraps fetch and XHR to capture auth headers from the page's own autosave requests
content.js Runs at document_idle; converts Markdown to Teletype XML and POSTs it to the drafts API

Markdown support

Supported Notes
H1 Becomes the document title, not a visible heading
H2, H3 Rendered as headings; added to the table of contents
Fenced code blocks Language tag is preserved for syntax highlighting
Blockquotes
Ordered and unordered lists
Bold, italic, bold+italic, strikethrough
Links
Images See the Images section
Embeds See the Embeds section
Horizontal rules

Unsupported Markdown features

These are valid Markdown but are not converted — they come through as plain text or are flattened:

Feature Result
H4 H6 Plain paragraph
Tables Plain text
Inline code `code` Backticks stripped, plain text
Nested lists Flat list items
Task lists (- [ ]) Regular list items
Footnotes Plain text
Raw HTML Plain text

Teletype features not expressible in Markdown

These must be added manually in the editor after import:

Feature Notes
Tags / hashtags #tag blocks attached to the post
Text alignment Centre or right-aligned paragraphs
Coloured section backgrounds Highlighted background behind any block
Underline <u> inline formatting
Iframe embeds Arbitrary URL iframes (not in the supported embed list)
Callout blocks Coloured section grouping mixed content (quotes, lists, etc.)
website embeds YouTube, X, TikTok, Rutube, Telegram, Figma, GitHub Gist, Yandex Maps, etc.