mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-24 06:33:33 +03:00
Merge pull request #900 from alexcrichton/fix-test
Escape HTML text in browser failure messages
This commit is contained in:
commit
69ec889dc5
@ -1,29 +0,0 @@
|
||||
rustc \
|
||||
+nightly \
|
||||
--crate-name \
|
||||
wasm_bindgen_test_runner \
|
||||
crates/test-runner/src/main.rs \
|
||||
--crate-type \
|
||||
bin \
|
||||
--emit=dep-info,link \
|
||||
-C \
|
||||
opt-level=s \
|
||||
-C \
|
||||
panic=abort \
|
||||
-C \
|
||||
lto \
|
||||
-C \
|
||||
metadata=de5c24b259631256 \
|
||||
-C \
|
||||
extra-filename=-de5c24b259631256 \
|
||||
--out-dir \
|
||||
/home/alex/code/wasm-bindgen/target/release/deps \
|
||||
-L \
|
||||
dependency=/home/alex/code/wasm-bindgen/target/release/deps \
|
||||
--extern \
|
||||
failure=/home/alex/code/wasm-bindgen/target/release/deps/libfailure-7c7642ad9a5ea78f.rlib \
|
||||
--extern \
|
||||
wasm_bindgen_cli_support=/home/alex/code/wasm-bindgen/target/release/deps/libwasm_bindgen_cli_support-319f8cb472c7d7e6.rlib \
|
||||
-L \
|
||||
native=/home/alex/code/wasm-bindgen/target/release/build/backtrace-sys-219bc8940e273b6b/out \
|
||||
-Z time-passes
|
@ -45,7 +45,14 @@ impl Browser {
|
||||
impl super::Formatter for Browser {
|
||||
fn writeln(&self, line: &str) {
|
||||
let mut html = self.pre.inner_html();
|
||||
html.push_str(&line);
|
||||
for c in line.chars() {
|
||||
match c {
|
||||
'<' => html.push_str("<"),
|
||||
'>' => html.push_str(">"),
|
||||
'&' => html.push_str("&"),
|
||||
c => html.push(c),
|
||||
}
|
||||
}
|
||||
html.push_str("\n");
|
||||
self.pre.set_inner_html(&html);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user