Rust crates (typstyle and typstyle-core) and native CLI binaries are available for v0.15.2. The WASM build failed, so @typstyle/typstyle-wasm-bundler v0.15.2 was not published to npm. WASM consumers should continue using their previous package version.
- Feature(CLI): Add
--line-ending=lf|crlf|preservewithpreserveas the default.
Preservation generates CRLF only when the input contains at least one CRLF
and has no bare LF or bare CR; otherwise it generates LF.lfandcrlfforce
generated breaks. The default
--checknow accepts formatted CRLF files; use--line-ending=lfto enforce LF.
(#496) - Feature(Core): Add
Config::line_endingandwith_line_endingfor LF, CRLF,
or default conservative preservation in document and partial formatting. Detection
uses the whole original document, including for range edits. Literal text remains
verbatim. The CLI uses the pretty renderer directly without output conversion. - Feature: Add
wrap_mode = "fill-sentence"/--wrap-text=fill-sentence, a middle ground
betweenfillandsentence: likesentence, each sentence starts on a new line; like
fill, each sentence's words are reflowed to the line width instead of leaving it as one
unbounded line or preserving manual line breaks. - Fix: Preserve trailing spaces and whitespace-only lines inside multiline strings, raw blocks, and format-disabled source instead of trimming every rendered line.
- Fix: Avoid generated indentation on blank lines and unnecessary flow spaces at line boundaries, including in partial formatting and aligned math. Line comments and block comments with leading stars still have trailing whitespace trimmed during comment formatting.
- Fix: Range formatting now matches document formatting when the range covers the whole source. Previously the returned edit could be narrower than the requested range and its content could miss document layout such as the final newline.
- Fix: Range formatting now honors
@typstyle offdirectives attached to syntax outside the selected range, including when the document has unrelated syntax errors. - Fix: Range formatting no longer deletes code separators when the selection is whitespace-only, such as an empty cursor position or a line break between statements.
- Fix: Range formatting of markup selections no longer adds document-level layout (such as a trailing newline) or layout inferred from source outside the replaced range.
- Fix: Range formatting of code keeps comments and semicolons at the replacement boundary, so the applied edit cannot merge the formatted fragment with the following statement.