README file from
GithubImport Fixer
Cleans up notes imported into Obsidian from web clippers (Evernote, etc.). Targets the common artifacts:
- Header favicons that render at 200+ px and dominate the note
- Reddit/Twitter/Zhihu UI icons (avatars, community badges, tracking pixels) scattered through the body
- Embedded
![[]]icons stuffed inside the link text of[…](url)references _resources/<long ugly name>.resources/folders left behind by Evernote import- Broken
![[…/X.resources/file.ext]]links pointing at folders that have since been renamed
sample document
Commands
| Command | What it does |
|---|---|
| Auto-fix current note (all fixes) | Runs Repair broken resource links then Shrink small UI icons in one shot. |
| Repair broken resource links in current note | For each ![[…/X.resources/file.ext]] link where X.resources no longer exists, scans every res_*.resources folder, finds the one containing the most of the missing files, and rewrites the link to point there. |
| Shrink small UI icons in current note | Adds |48 to wiki-link image embeds whose filename matches known icon patterns (favicons, avatars, Reddit communityIcon_*, Zhihu embedded.svg, web-1.0 spacer.gif, etc.). Random-hash content image filenames don't match and stay untouched. |
| Strip embedded icons | On the current selection, removes ![[…]] image embeds nested inside […](url) link text — leaves the link alone. |
Icon patterns recognised by Shrink
Favicons: touch.*, apple-touch-icon*, favicon*, logo[.-_]*
Generic prefixes: ico_*, ico-*, icon_*, emoji_*
Avatars: avatar*, default-avatar*, default_profile*, profile_image*, gravatar*, octocat*
Reddit: communityIcon*, image_widget_*, svg_<n>.svg, renderTimingPixel*
Zhihu / Twitter / SO: embedded.svg, zhihu-*, verified*, flair*
Spacers: spacer.*, pixel.*, 1x1.*, clear.*, transparent.*, blank.*, placeholder.*
Loaders: loading*, loader*, spinner*
UI words: arrow|chevron|bullet|dot|bg|bar|line|left|right|up|down|prev|next|star|check|cross|tick|caret|plus|minus|close|center|top|bottom|divider|separator|corner|border|frame|tab|header|footer followed by an optional suffix and extension.
Repair-links algorithm
- Index every file inside every
res_*.resourcesfolder under<note folder>/_resources/. - Walk every
![[…/X.resources/file.ext]]link in the note. - For broken folder references (where
X.resourcesdoesn't exist), tally which existing folders contain the referenced filenames. - The folder with the most matches wins; rewrite each broken link to point at it.
This handles the case where a previous import-cleanup run renamed folders but crashed before saving updated links.
Install (manual)
- Download
main.jsandmanifest.jsonfrom the latest Release. - Drop them into
<vault>/.obsidian/plugins/import-fixer/. - Enable Import Fixer in Settings → Community plugins.
Build
There is no build step — main.js is plain JavaScript using Obsidian's runtime API directly.
Notes
- Tested on macOS desktop with an iCloud-synced vault. Mobile is untested; the manifest currently sets
isDesktopOnly: false, but if you run on mobile please report any issues. - The repair command is destructive (it rewrites note content). Back up your vault or work on a copy the first time you run it.
- Console logs are gated behind
DEBUG = falseat the top ofmain.js. Flip totrueto see per-link decisions in the dev console.
License
MIT — see LICENSE.