<?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: PocketKit</title>
    <description>The latest articles on DEV Community by PocketKit (@linkguardtools).</description>
    <link>https://dev.to/linkguardtools</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%2F4275215%2F83ff0f50-2b9f-4007-8049-0b91a97b81e9.png</url>
      <title>DEV Community: PocketKit</title>
      <link>https://dev.to/linkguardtools</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/linkguardtools"/>
    <language>en</language>
    <item>
      <title>What a Notion export actually contains — and why "broken" imports are a link problem</title>
      <dc:creator>PocketKit</dc:creator>
      <pubDate>Tue, 01 Dec 2026 13:52:53 +0000</pubDate>
      <link>https://dev.to/linkguardtools/what-a-notion-export-actually-contains-and-why-broken-imports-are-a-link-problem-50ho</link>
      <guid>https://dev.to/linkguardtools/what-a-notion-export-actually-contains-and-why-broken-imports-are-a-link-problem-50ho</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I'm the developer of Notion Export Rescue, the tool at the end of this post. Everything below is about the file format, which is worth understanding even if you fix it by hand.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you have been on Notion's Free plan for a while, you have probably met the wall: a one-person Free workspace can add up to 5,000 blocks, and once you are there you can still read, edit, move and export everything — you just cannot add anything new. (Notion's help centre states the 5,000-block figure for a single-person workspace and 1,000 for two or more; older guides still call solo accounts unlimited, and the API reference still describes single-member workspaces as unlimited, so check what your own workspace shows.)&lt;/p&gt;

&lt;p&gt;The usual next step is File → Export → &lt;strong&gt;Markdown &amp;amp; CSV&lt;/strong&gt;. What comes back looks like a prank:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My Workspace/
  Project plan 1f0c8b2a9d4e4c1e8f3a5b6c7d8e9f01.md
  Meeting notes 2a7b3c4d5e6f47a8b9c0d1e2f3a4b5c6.md
  Tasks 9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a.csv
  image.png
  image.png
  image (1).png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is not a broken export. It is a &lt;em&gt;complete&lt;/em&gt; export that assumes an importer will do the work. When Obsidian (or any other tool) says "N broken links", it usually means the importer resolved links by file name, and Notion's export is not name-shaped.&lt;/p&gt;

&lt;p&gt;Here is what is actually in the ZIP, and what has to be true for the links to survive.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Every file name carries a 32-character ID
&lt;/h2&gt;

&lt;p&gt;Notion appends the page's block ID to the stem: &lt;code&gt;Project plan 1f0c8b2a9d4e4c1e8f3a5b6c7d8e9f01.md&lt;/code&gt;. The ID is the only stable identity in the archive. Titles change; IDs do not. Every internal link in the export points at a &lt;em&gt;path that contains that ID&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So the first rule of a clean vault is: strip the ID from the name, but keep a map from ID → output path, because links will be rewritten using the map, not the title.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;clean_stem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;notion_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;embedded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;split_notion_stem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;      &lt;span class="c1"&gt;# "Project plan 1f0c…f01" -&amp;gt; ("Project plan", "1f0c…f01")&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;clean_name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fallback&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Untitled {notion_id[:6]}"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three details matter more than they look:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;De-duplicate case-insensitively.&lt;/strong&gt; macOS and Windows treat &lt;code&gt;Plan.md&lt;/code&gt; and &lt;code&gt;plan.md&lt;/code&gt; as the same file; Linux does not. A vault that works on your laptop can silently lose a page on a NAS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filenames are not titles.&lt;/strong&gt; &lt;code&gt;&amp;lt; &amp;gt; : " / \ | ? *&lt;/code&gt;, control characters, trailing dots and spaces, and the reserved names (&lt;code&gt;CON&lt;/code&gt;, &lt;code&gt;PRN&lt;/code&gt;, &lt;code&gt;AUX&lt;/code&gt;, &lt;code&gt;NUL&lt;/code&gt;, &lt;code&gt;COM1&lt;/code&gt;…) are all legal in Notion titles and illegal on at least one major OS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normalise Unicode.&lt;/strong&gt; A title pasted from another system can arrive in NFD, so the same Japanese or accented title has two byte-level spellings that look identical on screen. &lt;code&gt;unicodedata.normalize("NFC", …)&lt;/code&gt; first, then clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Links are relative paths with percent-encoding
&lt;/h2&gt;

&lt;p&gt;A typical body link looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;See [Roadmap](../Projects/Roadmap%201f0c8b2a9d4e4c1e8f3a5b6c7d8e9f01.md#3a4b…)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To resolve it you have to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;percent-decode it (&lt;code&gt;%20&lt;/code&gt; → space, &lt;code&gt;%28&lt;/code&gt; → &lt;code&gt;(&lt;/code&gt;);&lt;/li&gt;
&lt;li&gt;resolve it &lt;strong&gt;relative to the folder of the page that contains the link&lt;/strong&gt;, not to the vault root;&lt;/li&gt;
&lt;li&gt;treat a trailing &lt;code&gt;#&amp;lt;32 hex&amp;gt;&lt;/code&gt; as a block ID, not a heading — dropping it is correct, because Obsidian headings are not Notion blocks;&lt;/li&gt;
&lt;li&gt;fall back to Notion IDs when the path lies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Point 4 is the one importers get wrong. Notion will happily export a link whose path says &lt;code&gt;Projects/Roadmap &amp;lt;id&amp;gt;.md&lt;/code&gt; while the page now lives in &lt;code&gt;Archive/Roadmap &amp;lt;id&amp;gt;.md&lt;/code&gt;. The ID inside the link is still right. Resolve by ID first, path second, unique title third:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# order of attempts inside resolve()&lt;/span&gt;
&lt;span class="c1"&gt;#   notion.so / notion.com URL  -&amp;gt; page or database by ID&lt;/span&gt;
&lt;span class="c1"&gt;#   *.csv                       -&amp;gt; database&lt;/span&gt;
&lt;span class="c1"&gt;#   path with an asset suffix   -&amp;gt; attachment (exact path, then unique basename)&lt;/span&gt;
&lt;span class="c1"&gt;#   *.md path                   -&amp;gt; page by exact path, then by embedded ID,&lt;/span&gt;
&lt;span class="c1"&gt;#                                  then by a unique title, then by title in the same folder&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Anything that still does not resolve is &lt;em&gt;not&lt;/em&gt; an error to hide. It is a fact about the export: the page was not exported (a sub-page you did not tick, a page in another workspace, a link to a database view). List it, leave the link text alone, and let the reader decide.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Links inside code are not links
&lt;/h2&gt;

&lt;p&gt;The rewrite has to skip fenced blocks and inline code, or it will corrupt every snippet that contains &lt;code&gt;[text](path)&lt;/code&gt; — which, in a developer's Notion, is a lot of them. A small scanner over the body is enough: record the character ranges covered by fences and inline code, and refuse to rewrite inside them.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Attachments are a separate namespace
&lt;/h2&gt;

&lt;p&gt;Images and files land next to the page (or in a folder, depending on the export), and names are frequently &lt;code&gt;image.png&lt;/code&gt;, &lt;code&gt;image (1).png&lt;/code&gt;, &lt;code&gt;Untitled.png&lt;/code&gt;. Copying them into one &lt;code&gt;assets/&lt;/code&gt; folder without renaming means the second &lt;code&gt;image.png&lt;/code&gt; overwrites the first — and the first reference now points at the wrong picture.&lt;/p&gt;

&lt;p&gt;Two rules fix it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generic names inherit the page they sit in: &lt;code&gt;image.png&lt;/code&gt; inside "Projects" becomes &lt;code&gt;Projects image.png&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;an existing file is only replaced if its bytes are identical. A different file with the same name gets a new name, never an overwrite.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;family&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;GENERIC_ASSET_NAMES&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="c1"&gt;# image, photo, screenshot, untitled, …&lt;/span&gt;
    &lt;span class="n"&gt;clean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"{clean_name(page.title)} {clean}"&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;allocator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allocate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;clean&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;suffix&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;extension&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Databases are three things at once
&lt;/h2&gt;

&lt;p&gt;A Notion database exports as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;one &lt;code&gt;.csv&lt;/code&gt; with a row per page, and&lt;/li&gt;
&lt;li&gt;one &lt;code&gt;.md&lt;/code&gt; per row (properties in the body, not in frontmatter), and&lt;/li&gt;
&lt;li&gt;a mapping from each CSV row to the page file it belongs to — by position and by recorded page link, not by title, because the file name carries an ID the CSV cell does not.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Turning that into something an editor understands means writing a Markdown page per database: YAML frontmatter for the database's own name, then a table of the rows, with each title cell linking to the row page. Row pages get their properties as frontmatter, so Obsidian's dataview-style queries and the sidebar both work. Writing YAML by hand is a trap — titles contain &lt;code&gt;:&lt;/code&gt;, &lt;code&gt;#&lt;/code&gt;, quotes and emoji — so render every string with JSON quoting (a subset of YAML double-quoted scalars) instead of a bespoke escaper.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Show the damage before writing anything
&lt;/h2&gt;

&lt;p&gt;The most useful part of a converter is the part that does not write. A dry run should say, before a single file is created:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how many pages, databases and rows the export contains;&lt;/li&gt;
&lt;li&gt;which links cannot be resolved, and why (page not exported vs. attachment missing);&lt;/li&gt;
&lt;li&gt;which attachments are referenced but absent;&lt;/li&gt;
&lt;li&gt;how many blocks are not convertible (kanban, calendar, gallery views).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That report is also the honest answer to "will this break my vault?". Nothing is written until you press the button, existing files are kept by default, and re-running on a fresh export writes only what actually changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does not do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Views are lost.&lt;/strong&gt; Kanban, calendar and gallery views export as plain pages. The data comes across; the layout does not. There is no way to reconstruct a view from a Markdown export.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing pages stay missing.&lt;/strong&gt; A link to a page you did not export cannot be invented. It is reported and left as text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synced blocks and embeds&lt;/strong&gt; become links or plain text.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML exports are not supported.&lt;/strong&gt; Choose "Markdown &amp;amp; CSV"; the HTML export has a different structure and no CSV databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Notion's block limit does not care about deletions.&lt;/strong&gt; If you are exporting to get under 5,000 blocks, note that deleting content does not lower the count on a Free workspace — Notion counts blocks created, not blocks kept. Exporting is for keeping your writing, not for resetting the counter.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  If you want to do it by hand
&lt;/h2&gt;

&lt;p&gt;It is a few hours of &lt;code&gt;os.rename&lt;/code&gt;, &lt;code&gt;urllib.parse.unquote&lt;/code&gt; and one careful pass over every &lt;code&gt;.md&lt;/code&gt;. The parts that bite are: case-insensitive dedupe, links inside code, generic attachment names, and the ID-first fallback. Do those four and a plain Obsidian import stops lying to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you would rather not
&lt;/h2&gt;

&lt;p&gt;I wrote Notion Export Rescue to do exactly the above, locally: it reads the ZIP you already have — no Notion login, no API token, no upload — cleans names, repairs links, collects attachments into &lt;code&gt;assets/&lt;/code&gt;, turns database CSVs into Markdown tables with YAML frontmatter, and prints the dry-run report first. Windows, macOS and Linux; Python 3.10+ with the standard library only, started from an included launcher.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Try it:&lt;/strong&gt; the unlicensed build converts &lt;strong&gt;100 pages in total&lt;/strong&gt;, with every feature on, no watermark and no time limit. Converting the same export twice does not spend the allowance twice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buy it:&lt;/strong&gt; &lt;strong&gt;$29 one-time&lt;/strong&gt; (one licence per person) — &lt;a href="https://linkguard.gumroad.com/l/notion-export-rescue" rel="noopener noreferrer"&gt;Notion Export Rescue on Gumroad&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The rest of the tools&lt;/strong&gt; (five Chrome extensions, two more local apps, one WooCommerce plugin) — &lt;a href="https://linkguard-tools.github.io/" rel="noopener noreferrer"&gt;linkguard-tools.github.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a specific export does not convert, the report tells you why; send me the report, not the export (&lt;a href="mailto:pocketkit.support@gmail.com"&gt;pocketkit.support@gmail.com&lt;/a&gt;).&lt;/p&gt;

</description>
      <category>python</category>
      <category>productivity</category>
      <category>markdown</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Automating someone else's UI: bulk-editing YouTube descriptions with a Manifest V3 extension</title>
      <dc:creator>PocketKit</dc:creator>
      <pubDate>Tue, 01 Dec 2026 00:37:44 +0000</pubDate>
      <link>https://dev.to/linkguardtools/automating-someone-elses-ui-bulk-editing-youtube-descriptions-with-a-manifest-v3-extension-1bjh</link>
      <guid>https://dev.to/linkguardtools/automating-someone-elses-ui-bulk-editing-youtube-descriptions-with-a-manifest-v3-extension-1bjh</guid>
      <description>&lt;p&gt;A channel with a few years of videos has descriptions full of links that quietly died: an affiliate programme that ended, a Discord invite that expired, a landing page that moved. YouTube Studio edits one video at a time. There is no find and replace across a channel.&lt;/p&gt;

&lt;p&gt;So the chore is: read every description, find the dead ones, replace them, and do not break anything else on the way. Two ways to automate that — the YouTube Data API, or driving the Studio page itself.&lt;/p&gt;

&lt;p&gt;I built the second one (Link Guard), and this post is about what that choice costs and the rules that made it survivable. Disclosure: I'm the developer, and it is a product with a free version. Everything below is from the shipped extension.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why drive the UI instead of the API
&lt;/h2&gt;

&lt;p&gt;The API is the polite path, and for a hosted service it is the right one. For this job it is a wall of setup: OAuth with a sensitive scope, Google's verification for that scope, a user cap while you are unverified, and a quota that every update spends. All of that has to exist before the first person can fix a dead link.&lt;/p&gt;

&lt;p&gt;The Studio path uses the session the user already has. No consent screen, no client secret stored anywhere, no refresh token to leak. The price is that you are now a small robot operating a page you do not own, against a DOM you do not control, with no promise that the markup survives next Tuesday.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1: never trust a save you did not observe
&lt;/h2&gt;

&lt;p&gt;The dangerous case is not the save that errors. It is the save that returns nothing: the click landed, no error appeared, and the page looks fine. Then you move to the next video, and forty videos later you notice that nothing was written.&lt;/p&gt;

&lt;p&gt;Studio gives two independent signals for a successful save: the Save button returns to its disabled state, and a snackbar says so. If neither appears, the save is unconfirmed — not "successful, with a slow UI". It is recorded as a failure for that video, and if two saves in a row cannot be confirmed the batch stops. Two in a row almost always means the page changed under you, and continuing would make the next few hundred writes guesses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 2: put the loop where the DOM is
&lt;/h2&gt;

&lt;p&gt;Manifest V3 service workers are terminated when idle, and Chrome decides when. A batch that keeps its loop in the worker dies in the middle of the channel and leaves no record of where it stopped.&lt;/p&gt;

&lt;p&gt;So the loop lives in the content script on the Studio tab. One step per message: open the next video, read the description, replace, save, confirm, advance. The worker owns the job record in &lt;code&gt;chrome.storage.local&lt;/code&gt; and answers "what is next". If the worker is killed mid-batch, the content script's next message wakes it and the job continues from storage. There is no in-memory truth to lose, because there is no in-memory truth.&lt;/p&gt;

&lt;p&gt;That split makes each step testable too: the content script runs against a fake Studio page, and the worker against stubbed &lt;code&gt;chrome.*&lt;/code&gt; APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 3: read the full text, not the preview
&lt;/h2&gt;

&lt;p&gt;The Content list shows a truncated description preview for every row. It is tempting to read all rows without opening a single video — much faster. It is also wrong: a match past the truncation point would be missed, and a replacement computed from a truncated string is not the string you are about to save.&lt;/p&gt;

&lt;p&gt;So the list preview is recorded as a hint only, and the edit page's description is the only text that is searched, replaced, backed up or written.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 4: back up at the moment of the write
&lt;/h2&gt;

&lt;p&gt;A backup taken while the user was reviewing the preview is already lying by the time the batch reaches video 40 — someone edited that video in another tab, or an earlier run changed it.&lt;/p&gt;

&lt;p&gt;So the backup is written immediately before the write, from the text actually on screen, one video at a time. Undo restores from that backup, and the restore itself writes a backup first, so undoing twice cannot destroy the state you were trying to return to.&lt;/p&gt;

&lt;h2&gt;
  
  
  What one step actually does
&lt;/h2&gt;

&lt;p&gt;The content script's step is deliberately small, and every branch ends in a recorded status rather than an exception:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;step&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;findEditor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'description'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;       &lt;span class="c1"&gt;// new selector, then the old one&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'editor_not_found'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;readText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                &lt;span class="c1"&gt;// the full text on screen&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;              &lt;span class="c1"&gt;// pure function, unit tested&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'no_match'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// never save a no-op&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;backup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;videoId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;before&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;              &lt;span class="c1"&gt;// before the write, not at preview&lt;/span&gt;
  &lt;span class="nf"&gt;writeText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;after&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;saveButton&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;confirmed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;confirmSaved&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// disabled again, or snackbar&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;confirmed&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="s1"&gt;'saved'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'unconfirmed'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rule 5: pace it like a person, and make stopping cheap
&lt;/h2&gt;

&lt;p&gt;Videos are opened at about 3.5 seconds apart by default. That is not politeness; it is the difference between one failed save and eighteen failed saves before anyone notices. Pause and Stop are normal states, and closing the batch tab is a third one: the job records "the job tab was closed" and stops rather than hanging.&lt;/p&gt;

&lt;p&gt;Every one of these states is visible in a progress panel inside the page, because a batch that runs invisibly in a background tab is a batch people will interrupt by closing things.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selector rot is the bill for this approach
&lt;/h2&gt;

&lt;p&gt;The Studio selectors this depends on are specific — &lt;code&gt;ytcp-social-suggestions-textbox#description-textarea #textbox&lt;/code&gt;, &lt;code&gt;ytcp-button#save&lt;/code&gt;, &lt;code&gt;ytcp-video-row&lt;/code&gt; — with the older shapes kept as fallbacks. When Studio changes them, the batch does not "mostly work". It reports &lt;code&gt;editor_not_found&lt;/code&gt; per video and skips, or it fails to confirm saves and stops.&lt;/p&gt;

&lt;p&gt;That is the trade, and it has to be said plainly on the product page: this is software that needs a human to look at Studio after a redesign. A batch tool that guesses at a changed page is worse than one that refuses, because a wrong write across a few hundred videos is not something an apology can undo.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other half: the links themselves
&lt;/h2&gt;

&lt;p&gt;Finding the dead links is the easier half, but the classification matters more than the check. A &lt;code&gt;HEAD&lt;/code&gt; request first, and if the server rejects &lt;code&gt;HEAD&lt;/code&gt;, a &lt;code&gt;GET&lt;/code&gt; with a Range header for a byte or two:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;404 / 410 → &lt;strong&gt;dead&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;connection refused or DNS failure → &lt;strong&gt;unreachable&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;timeout → &lt;strong&gt;timeout&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;5xx → &lt;strong&gt;server error&lt;/strong&gt;, not dead&lt;/li&gt;
&lt;li&gt;401 / 403 / 429 → &lt;strong&gt;blocked&lt;/strong&gt;, not dead&lt;/li&gt;
&lt;li&gt;3xx to a different host or path → &lt;strong&gt;redirect&lt;/strong&gt;, with where it went&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That third-from-last line is the important one. A lot of sites answer bots with 403 while serving people normally. Telling someone their working affiliate link is broken is worse than telling them it could not be checked, so "blocked" is its own status and never counted as dead.&lt;/p&gt;

&lt;p&gt;Network access is an optional permission requested when the user presses "Allow link checks". A tool that reads descriptions has no business being able to call arbitrary URLs until its owner asks it to.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you are automating a third-party UI
&lt;/h2&gt;

&lt;p&gt;Three things I would keep from this project, whatever the platform:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The save is the only evidence.&lt;/strong&gt; A click that returned, a spinner that vanished and a lack of an error toast are hopes, not proof. Read the platform's own confirmation and treat everything else as failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make failing boring.&lt;/strong&gt; Per-item status, one stop button, a backup on disk in a format that is usable without the tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Say the terms part out loud.&lt;/strong&gt; Automating clicks is automation. Whether that is acceptable is the platform's call, not the developer's — and it belongs on the product page, not in a footnote.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The honest position for a tool like this is: paced, visible, stoppable, backed up, and the decision to run it stays with the person whose channel it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool
&lt;/h2&gt;

&lt;p&gt;Link Guard has a free version on the Chrome Web Store — 50 videos scanned, 10 edits per batch, every preview feature: &lt;a href="https://chromewebstore.google.com/detail/acpjoaadfmjhchnkgipglagefmbnphfa" rel="noopener noreferrer"&gt;https://chromewebstore.google.com/detail/acpjoaadfmjhchnkgipglagefmbnphfa&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pro ($9/month or $79/year) removes those limits and adds the daily dead-link watch: &lt;a href="https://linkguard.gumroad.com/l/link-guard-pro" rel="noopener noreferrer"&gt;https://linkguard.gumroad.com/l/link-guard-pro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The store page lists all the tools and their limits, in plain words: &lt;a href="https://linkguard-tools.github.io/" rel="noopener noreferrer"&gt;https://linkguard-tools.github.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have automated a third-party UI and found a failure mode I am missing, I would like to hear it — especially the ones that only appear on video 200.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Why web clippers drop code blocks and tables — and how I convert full articles into real Notion blocks locally</title>
      <dc:creator>PocketKit</dc:creator>
      <pubDate>Tue, 01 Dec 2026 00:23:58 +0000</pubDate>
      <link>https://dev.to/linkguardtools/why-web-clippers-drop-code-blocks-and-tables-and-how-i-convert-full-articles-into-real-notion-4n93</link>
      <guid>https://dev.to/linkguardtools/why-web-clippers-drop-code-blocks-and-tables-and-how-i-convert-full-articles-into-real-notion-4n93</guid>
      <description>&lt;p&gt;Most "save to Notion" tools don't lose your article on purpose. They lose it in two places, and neither of them is the Notion API.&lt;/p&gt;

&lt;p&gt;I build Notion Clip Pro, a Chrome extension that clips a page into the reader's own Notion database with their own integration token. Before that I used several clippers, and kept finding the same thing in my own database: a page with the title, the URL, and a body that starts out as an article and then quietly stops being one. Headings become bold paragraphs. Code comes out as a grey block with no language and no indentation. Tables come out as lines of text with the pipes still in them.&lt;/p&gt;

&lt;p&gt;This post is about the two failure points, the parts of the Notion API that dictate the shape of the fix, and what still doesn't work — because that last list is the useful half.&lt;/p&gt;

&lt;p&gt;Disclosure: I'm the developer, and the extension is a product. The code below is from the shipped extension, not a sketch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The API is not the bottleneck
&lt;/h2&gt;

&lt;p&gt;Everything a clipper needs is in the API: &lt;code&gt;code&lt;/code&gt; blocks with a &lt;code&gt;language&lt;/code&gt; field, &lt;code&gt;table&lt;/code&gt; blocks with &lt;code&gt;table_row&lt;/code&gt; children, &lt;code&gt;image&lt;/code&gt; blocks with an external URL (so no upload is needed), and headings, quotes, list items, dividers and bookmarks.&lt;/p&gt;

&lt;p&gt;The API also sends CORS headers, so an extension's service worker can call &lt;code&gt;api.notion.com&lt;/code&gt; directly with the user's own token. That is what makes a clipper with no backend possible at all: the token lives in &lt;code&gt;chrome.storage&lt;/code&gt;, and the only network destination is Notion.&lt;/p&gt;

&lt;p&gt;Four hard limits decide the architecture:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Limit&lt;/th&gt;
&lt;th&gt;What it forces&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;2,000 characters per rich text object&lt;/td&gt;
&lt;td&gt;split text, without breaking surrogate pairs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100 rich text objects per block&lt;/td&gt;
&lt;td&gt;a very long paragraph becomes several blocks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;100 blocks per create/append request&lt;/td&gt;
&lt;td&gt;chunk the page, and never split a table from its rows&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;a table must arrive with its rows and a matching &lt;code&gt;table_width&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;a table is one unit or it is nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Failure point one: extraction throws the structure away
&lt;/h2&gt;

&lt;p&gt;The cheap way to clip a page is &lt;code&gt;document.body.innerText&lt;/code&gt;, or "run Readability, take the paragraphs". Both produce a string, and a string has no block boundaries. Once the article is a string, &lt;code&gt;h2&lt;/code&gt;, &lt;code&gt;p&lt;/code&gt; and &lt;code&gt;pre&lt;/code&gt; are indistinguishable, and whatever converts it downstream can only guess.&lt;/p&gt;

&lt;p&gt;So extraction never lets it become a string. It walks the DOM and emits an intermediate block list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// h1..h3   -&amp;gt; {type:'heading_2', rich:[{text,bold,italic,code,link}]}&lt;/span&gt;
&lt;span class="c1"&gt;// p        -&amp;gt; {type:'paragraph', rich:[...]}&lt;/span&gt;
&lt;span class="c1"&gt;// pre&amp;gt;code -&amp;gt; {type:'code', text, language}&lt;/span&gt;
&lt;span class="c1"&gt;// ul / ol  -&amp;gt; {type:'bulleted_list_item' | 'numbered_list_item', rich:[...]}&lt;/span&gt;
&lt;span class="c1"&gt;// table    -&amp;gt; {type:'table', rows:[[cell]], hasColumnHeader}&lt;/span&gt;
&lt;span class="c1"&gt;// img      -&amp;gt; {type:'image', url, caption}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That intermediate format is the whole design. It is JSON-safe, because it has to travel from the page back to the service worker through &lt;code&gt;chrome.scripting.executeScript&lt;/code&gt;. It is testable without a browser. And conversion into Notion blocks becomes a pure function of data.&lt;/p&gt;

&lt;p&gt;Choosing the container is the Readability problem, and the scoring is close to theirs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;textLength&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;linkDensity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;paragraphs&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'article'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="nf"&gt;countTags&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;nav&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;aside&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;180&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details matter more than the formula:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reject by link density.&lt;/strong&gt; A container that is 55% anchor text is a list of links, not an article, however many words it holds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Split "noise" into two strengths.&lt;/strong&gt; &lt;code&gt;ad&lt;/code&gt;, &lt;code&gt;sponsor&lt;/code&gt;, &lt;code&gt;comment&lt;/code&gt;, &lt;code&gt;share&lt;/code&gt;, &lt;code&gt;related&lt;/code&gt;, &lt;code&gt;cookie&lt;/code&gt;, &lt;code&gt;sidebar&lt;/code&gt; are always furniture. &lt;code&gt;widget&lt;/code&gt;, &lt;code&gt;author&lt;/code&gt;, &lt;code&gt;meta&lt;/code&gt;, &lt;code&gt;promo&lt;/code&gt; are usually furniture — but not always. One documentation site I test against ships its entire article inside &lt;code&gt;div class="medium-widget"&lt;/code&gt;. So weak signals are removed only when the element doesn't read like prose, meaning it contains no paragraph of reasonable length.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Failure point two: conversion is a pile of small, specific rules
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Code language.&lt;/strong&gt; A &lt;code&gt;pre&lt;/code&gt; block almost never says what language it holds. It hints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;language-python&lt;/code&gt;, &lt;code&gt;lang-js&lt;/code&gt; from highlight.js and Prism&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;highlight-source-js&lt;/code&gt; from GitHub&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;brush: python&lt;/code&gt; from SyntaxHighlighter&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;data-lang="ts"&lt;/code&gt; from whoever wrote the theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So collect signatures from the &lt;code&gt;&amp;lt;code&amp;gt;&lt;/code&gt; element and from the &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt;, regex for those prefixes, and then map the result onto the set of values Notion actually accepts. &lt;code&gt;js&lt;/code&gt; has to become &lt;code&gt;javascript&lt;/code&gt;, &lt;code&gt;py&lt;/code&gt; becomes &lt;code&gt;python&lt;/code&gt;, &lt;code&gt;c++&lt;/code&gt; stays &lt;code&gt;c++&lt;/code&gt;. Notion validates &lt;code&gt;language&lt;/code&gt; against an enum, so an unmapped value isn't a graceful fallback, it's a 400. Anything unknown becomes &lt;code&gt;plain text&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Splitting text.&lt;/strong&gt; 2,000 characters per rich text object, and a naive &lt;code&gt;slice(0, 2000)&lt;/code&gt; will eventually cut a surrogate pair in half — an emoji, or Japanese text outside the BMP. Notion stores what you send, so you get a lone surrogate and a broken character in the page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mh"&gt;0xd800&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mh"&gt;0xdbff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;end&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// don't cut a surrogate pair&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tables.&lt;/strong&gt; A &lt;code&gt;table&lt;/code&gt; block must arrive with its rows as children and a &lt;code&gt;table_width&lt;/code&gt; matching the widest row. Each cell is an array of rich text objects, so a cell can still hold a link or bold text. Rows count against the 100-block request limit, which is why chunking weighs a table as one unit plus its rows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;weight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'table'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;block&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;table&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;children&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A table with 120 rows becomes two table blocks, 80 rows and 40 rows, both with the same width. It is ugly, but it keeps every cell aligned and every request under the limit. Creating the table empty and appending rows afterwards also works; it is slower and leaves a half-built table if it fails midway.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Images.&lt;/strong&gt; Notion accepts either an uploaded file or an external URL. External keeps the clipper serverless — no proxy, no storage — and the cost is that the page keeps depending on the source site: when the image disappears there, the Notion page shows a broken image. Uploading would fix that and need either a server or a per-file round trip per image. I chose external URLs and wrote that trade-off into the listing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chunking, and the retry that actually matters.&lt;/strong&gt; 100 blocks per request. When request 3 of 7 fails you have a half-written page, and the retry must not resend chunks 1 and 2, or the page gets its first 200 blocks twice. Keep only the unsent tail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="n"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pending&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;remaining&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One line, and it is the difference between "retry" and "delete the page and start again" — which, on a 1,500-block article, is not a small difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  Duplicates, and why the check belongs before the write
&lt;/h2&gt;

&lt;p&gt;A clipper that quietly creates a second page for the same URL makes the database worse every time you use it. The fix is not clever: query the data source before writing, filtering on the URL property, and if a row already exists, link to it instead of creating another one.&lt;/p&gt;

&lt;p&gt;If you address Notion databases from the API today, one thing will bite. Since the 2025-09-03 API version a database can hold several data sources, and a database read with an older &lt;code&gt;Notion-Version&lt;/code&gt; fails once a second source exists. Address &lt;code&gt;data_source&lt;/code&gt; objects instead: &lt;code&gt;GET /v1/data_sources/{id}&lt;/code&gt; for the schema, &lt;code&gt;POST /v1/data_sources/{id}/query&lt;/code&gt; to search, and create pages with &lt;code&gt;parent: {type: 'data_source_id'}&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What still fails
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Login-gated pages&lt;/strong&gt;: the script reads what is rendered, so a paywalled article saves as far as the visible part and no further.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDFs and &lt;code&gt;chrome://&lt;/code&gt; pages&lt;/strong&gt;: extensions cannot be injected into them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Canvas-rendered or image-only text&lt;/strong&gt;: extraction yields almost nothing, and no amount of block mapping fixes that.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infinite scroll&lt;/strong&gt;: the script runs on the DOM as it is when the clip is pressed. Text that has not been rendered yet is not there.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Very long pages&lt;/strong&gt;: capped at 1,500 blocks, with a visible note at the point where it was cut.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sites that change their markup&lt;/strong&gt;: the ongoing maintenance cost of every clipper, and mine is not exempt.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why "no server" was worth the constraints
&lt;/h2&gt;

&lt;p&gt;Calling the API directly from the extension means there is no account to create, no quota to meter on my side, no place your articles pass through, and nothing of mine to breach. The token stays in the browser. The free limit — 20 clips a month on the free version — is a counter in extension storage that increments after a successful clip rather than before, because charging someone for a failure is a small betrayal that people notice and do not forget.&lt;/p&gt;

&lt;p&gt;The costs are real: no server-side rendering for problem pages, no image hosting, no way to fix extraction for a broken site without shipping a new version, and a store review between me and every fix.&lt;/p&gt;

&lt;p&gt;If you build a clipper, the intermediate block list is the decision I would make again. The 2,000-character splits, the language allowlist and the table weights are all downstream of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The extension
&lt;/h2&gt;

&lt;p&gt;Notion Clip Pro is on the Chrome Web Store as a free version — 20 clips a month, all the block mapping above, nothing to pay to find out whether it works on the pages you actually read: &lt;a href="https://chromewebstore.google.com/detail/ijpjkejlblhggefjpkhhlllbehboobjf" rel="noopener noreferrer"&gt;https://chromewebstore.google.com/detail/ijpjkejlblhggefjpkhhlllbehboobjf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pro ($6/month or $49/year) adds unlimited clips, custom property mapping, duplicate checking and bulk retry: &lt;a href="https://linkguard.gumroad.com/l/notion-clip-pro" rel="noopener noreferrer"&gt;https://linkguard.gumroad.com/l/notion-clip-pro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is also on Product Hunt today: &lt;a href="https://www.producthunt.com/products/notion-clip-pro" rel="noopener noreferrer"&gt;https://www.producthunt.com/products/notion-clip-pro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The store page lists the limitations of all the tools, including the ones I forgot to put in this post: &lt;a href="https://linkguard-tools.github.io/" rel="noopener noreferrer"&gt;https://linkguard-tools.github.io/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If a page comes out badly for you, a URL is worth more to me than a verdict — paste it in the comments and I'll look at what the extractor did with it.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
