Skip to content

Commit 24ea527

Browse files
committed
compress default
1 parent 312a84c commit 24ea527

File tree

4 files changed

+5
-42
lines changed

4 files changed

+5
-42
lines changed

ansi2-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansi2-wasm/package.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ansi2-wasm/src-ts/cli.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { to_svg, to_html, to_text, Theme, to_ans } from "./wasm"
22
import { readFileSync, existsSync } from "node:fs"
3-
import { optimize } from "svgo"
43
import { Mode } from "./wasm"
54
import { version } from "../package.json"
65
import * as t from "typanion"
@@ -76,19 +75,6 @@ class AnsiCmd extends Command {
7675
const lightBg = this.lightBg
7776
const darkBg = this.darkBg
7877

79-
// console.log({
80-
// theme,
81-
// mode,
82-
// format,
83-
// width,
84-
// font,
85-
// compress,
86-
// fontSize,
87-
// lengthAdjust,
88-
// lightBg,
89-
// darkBg,
90-
// })
91-
9278
const input = await readToString()
9379
switch (format) {
9480
case "svg": {
@@ -103,21 +89,7 @@ class AnsiCmd extends Command {
10389
fontSize,
10490
lengthAdjust,
10591
)
106-
const result = compress
107-
? optimize(s, {
108-
plugins: [
109-
{
110-
name: "preset-default",
111-
params: {
112-
overrides: {
113-
inlineStyles: false,
114-
},
115-
},
116-
},
117-
],
118-
}).data
119-
: s
120-
process.stdout.write(result)
92+
process.stdout.write(s)
12193
break
12294
}
12395
case "html": {

ansi2/src/main.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ struct Args {
3434
#[arg(long)]
3535
font: Option<String>,
3636

37-
#[arg(short, long, default_value_t = false)]
38-
compress: bool,
39-
4037
#[arg(long)]
4138
light_bg: Option<String>,
4239
#[arg(long)]
@@ -71,7 +68,6 @@ fn main() {
7168
theme,
7269
mode,
7370
font,
74-
compress,
7571
light_bg,
7672
dark_bg,
7773
font_size,
@@ -103,7 +99,7 @@ fn main() {
10399

104100
let output = match format {
105101
Format::Svg => {
106-
let mut svg = to_svg(
102+
let svg = to_svg(
107103
s,
108104
theme,
109105
width,
@@ -115,12 +111,8 @@ fn main() {
115111
length_adjust,
116112
sourcemap,
117113
);
118-
if compress {
119-
#[cfg(feature = "minify")]
120-
{
121-
svg = minify_svg(&svg).expect("compress error");
122-
}
123-
}
114+
#[cfg(feature = "minify")]
115+
let svg = minify_svg(&svg).expect("compress error");
124116
svg
125117
}
126118
Format::Html => to_html(

0 commit comments

Comments
 (0)