Releases: typstyle-rs/typstyle
Release list
v0.15.1
- Update
typstto v0.15.1. - Add experimental sentence-level text wrapping with
wrap_mode = "sentence"or--wrap-text=sentence. Breaking: the booleanwrap_textconfiguration option is replaced bywrap_mode; migratetrueto"fill"andfalseto"none". The existing bare--wrap-textCLI flag remains supported as shorthand for--wrap-text=fill.
v0.15.0
- Bump
typstto v0.15.0. With the new typst math parser, the formatting of math arguments has also improved slightly as a side effect.
v0.14.4
- Fix git submodule ghost that prevents publishing.
v0.14.0
- Feature: Bump typst-syntax to v0.14.0.
v0.13.19
- Bug fix: Previously, empty headings with attachments like
= <label>or= //will be formatted as= <label>or= //(an extra space is inserted), which does not converge. Now it is fixed.
v0.13.18
- Bug fix: Previously,
@typstyle offis not correctly recognized for{table,grid}.{header,footer}. Now it is fixed. - Revert: The body of strong/emph is no longer indented.
Playground
- Feature: Added some loadable sample documents.
- Feature: The active output tab is now persisted in the URL.
v0.13.17
Core
-
Feature: Improved flavor detection for list-like syntaxes.
Previously, flavor detection checked only whether the first space contained a line break, leading to unexpected multiline layout when child expressions contained line breaks or spaces. Now, a list-like syntax is considered multiline only if there is a space containing a line break before its first child expression.
For example, this code was previously treated as multiline due to the line break before), but now uses the compact layout:#f(it => it )
-
Feature: Aligned equation flavor detection with other nodes.
For example,$ a $
was previously regarded as multiline due to the break before the closing
$. Now it formats as$ a $
enabling inline block switching by adjusting the space after the opening
$. -
Feature: Raw blocks are combinable now.
-
Feature: Compact layout for markup.
For a content block, strong, or emph node, if its opening boundary is non-breakable, contains no breaks, and has exactly one primary expression (excluding labels, break symbols, and plain text), it is rendered without indentation. -
Feature: Indent the body of strong or emph expressions when not using the compact layout.
-
Fix: Corrected misplaced standalone comments in method chains.
In this example,#( foo // comment .bar() )
it previously formatted as
#( foo // comment .bar() )
Now the comment correctly stays on its own line.
-
Fix: Prevent reflow of text segments that can be parsed as enum item markers.
text 01.
Previously formatted as
text 01.
which created an unintended enum item. Now it remains on one line.
-
Fix: Do not insert an extra break at a nil boundary for headings. Now the code
#[= h1]will not be formatted as
#[ = h1 ]
in any case.
Playground
- Feature: Use system color preference as the default theme.
- Feature: Persist the current state (code and options) in the URL for easy sharing.
- Feature: Store source code in local storage; if absent from the URL, the stored code is used as a fallback.
- Feature: Enable in-place formatting (full document or selection) in the source editor.
- Feature: Added a loading spinner and error boundary.
- Feature: Toggle word wrap in the source editor.
- Feature: Option to display only the formatted selectionâs output.
- Feature: Reduced indentation size in the output AST/IR from 4 spaces to 2.
Documentation
- Feature: Switched documentation theme from mdBook to Starlight.
- Feature: Added âcopy codeâ support.
Miscellaneous
- Moved the benchmark-results repository to the
typstyle-rsorganization.
v0.13.16
- Due to ci configuration issues, we failed to publish v0.13.15. This release is a re-publish of v0.13.15 with the correct version number.
v0.13.15 - [2025-07-18]
-
Feature(CLI): Add
--diffoption to show unified diff of formatting changes. This allows users to preview what changes would be made before applying formatting.For example:
typstyle file.typ --diff
Output:
--- file.typ +++ file.typ @@ -1,3 +1,3 @@ -#let x=1+2 -#let y=(3*4) +#let x = 1 + 2 +#let y = (3 * 4)
-
Feature: Improve comment handling - line comments are now treated as line suffixes instead of separate lines, resulting in more compact and natural formatting.
For example, The following code will be accepted by typstyle now:
#let result = (x + y) / 2 + 1 // This comment stays on same line
But it will be formatted to this in previous versions. Note that the comment was moved to a new line, which is not ideal for inline comments.
// line width = 40 #let result = ( (x + y) / 2 + 1 ) // This comment stays on same line
-
Feature: Add support for sharing links in the web playground, making it easier to share formatted code snippets with others for demo or collaboration.
-
Performance: Bump prettyless to v0.3.0. This slightly improves performance and lowers memory consumption during formatting.
v0.13.14
We now employ prettyless as the layout engine. It provides more features to support us to adopt better layout logic.
-
Feature: Long lines after the first line will no longer cause compact layout to fail to fit.
For example:#figure(caption: [], { "looooooooooooooooooooooooooong" })
It now fits in the compact layout regardless of the length of any long line in the code block.
-
Feature: We now respect the flavor of arguments in any case, except that the sole argument is a code block, which is always folded. This reverts the behavior of "force folding" when the sole argument is combinable, so that users can freely decide whether the argument should be compact. This change is expected not to affect your code if it is already compact.
For example:#f( (1, 2, 3) )
was formatted to
#f((1, 2, 3))
Now it is kept unchanged given its multiline flavor.
-
Bug fix: In code mode,
std.tablewas not recognized as a table function, preventing proper table formatting. -
Bug fix: Fixed incorrect formatting of table functions with empty content blocks.
Whentable.headerortable.footerhad no parentheses (()), the formatter would incorrectly add parentheses before empty content blocks. When parenthesized args are empty, the formatter would insert a line break with short line length.
For example:#table( columns: 2, table.header[], table.footer(), )
was formatted to:
#table( columns: 2, table.header()[], table.footer(), )
or with short line length:
#table( columns: 2, table.header( )[], table.footer( ), )
-
Bug fix: Fixed incorrect handling of trailing content blocks in set rules.
Previously, when there were no parentheses, a following content block would be wrapped by(); when parentheses were already present, any trailing content block was dropped.
For example:#set circle[1] #set circle()[1] #set circle(stroke: blue)[1]
was previously formatted to:
#set circle([1]) #set circle() #set circle(stroke: blue)
v0.13.13
- Bug fix(CI): Fixed a CI misconfiguration that prevented the release of v0.13.12.
v0.13.12 - [2025-07-02]
ð typstyle has moved to https://github.com/typstyle-rs/typstyle !
-
Bug fix(#334): Fixed incorrect formatting when term description is empty in definition lists.
-
Feature: Improved argument layout logic - do not use compact layout when arguments have multiline flavor, providing better formatting for complex function calls.
-
Feature: Enhanced math formatting - no longer align backslashes in mathematical expressions for cleaner output.
-
Feature: Introduced
typstyle-typlugincrate for embedding typstyle as a WebAssembly plugin within Typst documents.