Skip to content

Writing modes and behaviour ​

Layout scope ​

The plugin uses CSS writing-mode and logical CSS properties to lay out the Milkdown root and editor. It does not reset or provide colours, fonts, borders, spacing design, or other theme visuals. Choose and validate a Milkdown theme in your application.

ModeReading layout
horizontal-tbStandard horizontal lines from top to bottom.
vertical-rlVertical lines, with columns progressing from right to left.
vertical-lrVertical lines, with columns progressing from left to right.

Scrolling and switching ​

In a vertical mode, a normal vertical mouse-wheel or trackpad gesture moves through the content's horizontal reading direction. If the pointer is inside a nested element that can scroll vertically, that nested element consumes the gesture first.

Calling changeWritingMode(mode) does not rebuild Milkdown. It preserves the document, selection, and undo history, then restores the logical reading progress in the new mode.

Line length and images ​

lineLength is the maximum advance per line in full-width ideographic character units. It constrains the logical inline axis: line width in horizontal-tb and column height in vertical modes. null or an omitted option means no limit.

When a limit is active, an image receives only max-inline-size. It is not stretched and its intrinsic aspect ratio is not changed.

Browser support and integration limits ​

Chromium, Firefox, and Safari are the support targets. Browser behaviour around vertical text, IME composition, selection, and embedded content can still interact with your theme and application. Test those workflows in the browsers and configurations you ship.

This plugin does not parse or support MDI, ruby, or tate-chu-yoko.

Live demo ​

Switch the mode and line length to inspect the layout and scrolling direction:

Released under the MIT License.