Skip to content

Releases

2.0.7

Choose a tag to compare

@kdnk kdnk released this 19 Oct 16:30

Fixes

  • Preserve an immediately adjacent under-indented closing fence after a list code block instead of adding another fence.
  • Allow Obsidian Linter 3.0.2 to correct the original closing-fence indentation during the Automatic Linker save pipeline.
  • Preserve nested lists, tabs, command contents, and distinct named or blank-separated code blocks across repeated formatting.

Use with Obsidian Linter 3.0.2 for automatic indentation correction.

2.0.6

Choose a tag to compare

@kdnk kdnk released this 13 Sep 12:37
08d0540

What's Changed

  • chore(release): release 2.0.6 by @kdnk in #3

Full Changelog: 2.0.5...2.0.6

2.0.5

Choose a tag to compare

@kdnk kdnk released this 12 Sep 08:20

Full Changelog: 2.0.4...2.0.5

2.0.4

Choose a tag to compare

@kdnk kdnk released this 12 Sep 07:46
Release 2.0.4

2.0.3

Choose a tag to compare

@kdnk kdnk released this 11 Sep 01:34
1063f30

Fix indented code being converted to prose during Markdown formatting, especially inside ordered lists and beside lists whose markers are normalized.

  • Preserve ambiguous code together with its list context, outer indentation, and nested comments.
  • Continue formatting unaffected headings, tables, and lists.
  • Retain the awaitable formatting API and the existing scroll-position protection used by Automatic Linker.

Validation: 65 tests, production build, independent CommonMark review over 2,000 generated cases, and 72 additional YAML/source-boundary cases. In Obsidian, the combined pipeline passed 28 property/widget/cursor configurations and 80 saves with no save-induced viewport movement.

For the Automatic Linker → Prettier → Linter workflow, use Automatic Linker 4.10.2 and Linter fork 1.33.0-rc-1-kdnk.2. Disable Linter's remove-empty-lines-between-list-markers-and-checklists rule when Prettier controls list spacing; otherwise the formatters repeatedly undo each other's edits.

2.0.2

Choose a tag to compare

@kdnk kdnk released this 10 Sep 14:27

Fixes

  • Prevent repeated Markdown formatting from shifting visible content by a few pixels.
  • Preserve the visible block when properties or callout widgets are expanded or collapsed, without jumping to an offscreen cursor.
  • Settle pending layout measurements before capturing the viewport, and cancel stale formatting if measurement callbacks edit or switch the note.

Save orchestration remains in the calling plugin, and the awaitable format() method and manual command are unchanged. Older editors without scroll snapshot support can still format.

Validation

  • 52 automated tests passed, including viewport mapping, pending widget measurements, and cancellation during measurement.
  • TypeScript, the production build, ESLint, and independent code review passed.
  • The production bundle passed 43 applicable live Obsidian conditions and 117 cycles with 0 px movement across formatting, including 40 actual save cycles. Coverage includes properties/callout open and closed states, offscreen cursors, repeated indentation repair, and viewing widget content during saves. One offscreen-cursor condition was inapplicable because the cursor remained visible. Live checks used an unzoomed daily note at display scale 1.

2.0.1

Choose a tag to compare

@kdnk kdnk released this 10 Sep 11:44

Changes

  • Remove the built-in save hook and Format on save setting so calling plugins can control the formatting sequence.
  • Keep the Format current file command and expose the awaitable format() method. Its Promise resolves after the editor update.
  • Read indentation from Obsidian's Editor settings and ignore legacy saved plugin options.

Migration

Automatic formatting now requires a calling plugin such as Automatic Linker. Enable its Prettier stage, and, if using Linter, enable its Linter stage and disable Linter's Lint on save. The coordinated order is links → Prettier → Linter. Manual formatting remains available through Format current file.

The minimum Obsidian version remains 0.15.0.

Validation

  • 38 automated tests passed, including manual formatting, both save-handler variants, and legacy settings.
  • TypeScript checks, the production build, and ESLint passed.

2.0.0

Choose a tag to compare

@kdnk kdnk released this 10 Sep 11:04

Breaking changes

  • List hierarchy indentation now follows the current Obsidian Editor tab and spacing settings. Skipped indentation levels are repaired before Prettier runs, so formatting existing notes can change their list structure. For example, an eight-space child directly under a root becomes a one-tab child when tabs are enabled.
  • Current Obsidian Editor settings take precedence over legacy indentation values saved by the plugin. Existing intermediate list ancestors are retained; descendants and continuation lines move with their owning item.
  • Embedded code formatting is disabled. Code-content whitespace is preserved, and blocks containing multiline inline code, links, images, or reference definitions are kept out of Prettier's formatting pass.

Improvements

  • Apply formatting as a single atomic editor change, with no edit when the output is unchanged.
  • Discard formatting results if typing or navigation changes the active document while formatting is running.
  • Support both tabs and configured space indentation, with Markdown-aware handling of ordered lists and protected content.
  • Align package, manifest, and compatibility metadata at version 2.0.0. The declared minimum Obsidian version remains 0.15.0.

Automatic Linker migration

If Automatic Linker coordinates saving, disable this plugin's Format on save and Linter's Lint on save, then enable Automatic Linker's Prettier and Linter stages. The order is links → Prettier → Linter. Install this release before updating to an Automatic Linker version that removes its old indentation-cleanup option, and avoid conflicting Linter indentation rules.

Installation

Extract obsidian-prettier-plugin.zip into your vault's .obsidian/plugins/prettier-format/ directory, or copy the attached main.js, manifest.json, and styles.css there, then reload the plugin.

Validation

  • 35 automated tests passed, covering real Prettier formatting, idempotence, protected content, and editor application.
  • TypeScript checks, production build, and ESLint passed.