Skip to content

Commit ce95877

Browse files
committed
put terminal behind a feature so wasm compiles without
1 parent a445fa5 commit ce95877

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

crates/quarto-markdown-pandoc/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ repository.workspace = true
1414
cargo-fuzz = true
1515

1616
[features]
17-
default = ["terminal-hyperlinks"]
17+
default = ["terminal-support"]
18+
terminal-support = ["dep:crossterm", "dep:supports-hyperlinks"]
1819
terminal-hyperlinks = ["dep:supports-hyperlinks"]
1920

2021
[dependencies]
@@ -34,7 +35,7 @@ yaml-rust2 = { workspace = true }
3435
hashlink = { version = "0.10.0", features = ["serde_impl"] }
3536
error-message-macros = { path = "./error-message-macros" }
3637
ariadne = "0.4"
37-
crossterm = "0.28"
38+
crossterm = { version = "0.28", optional = true }
3839
supports-hyperlinks = { version = "3.0", optional = true }
3940

4041
[dev-dependencies]

crates/quarto-markdown-pandoc/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ fn main() {
177177
"native" => writers::native::write(&pandoc, &mut buf),
178178
"markdown" | "qmd" => writers::qmd::write(&pandoc, &mut buf),
179179
"html" => writers::html::write(&pandoc, &mut buf),
180+
#[cfg(feature = "terminal-support")]
180181
"ansi" => writers::ansi::write(&pandoc, &mut buf),
181182
_ => {
182183
eprintln!("Unknown output format: {}", args.to);

crates/quarto-markdown-pandoc/src/writers/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2025 Posit, PBC
44
*/
55

6+
#[cfg(feature = "terminal-support")]
67
pub mod ansi;
78
pub mod html;
89
pub mod json;

crates/wasm-qmd-parser/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ crate-type = ["cdylib", "rlib"]
1111
default = ["console_error_panic_hook"]
1212

1313
[dependencies]
14-
quarto-markdown-pandoc = { workspace = true }
14+
quarto-markdown-pandoc = { path = "../quarto-markdown-pandoc", default-features = false }
1515
wasm-bindgen = "0.2.89"
1616

1717
# The `console_error_panic_hook` crate provides better debugging of panics by

0 commit comments

Comments
 (0)