mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-02 02:11:06 +00: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 {
|
impl super::Formatter for Browser {
|
||||||
fn writeln(&self, line: &str) {
|
fn writeln(&self, line: &str) {
|
||||||
let mut html = self.pre.inner_html();
|
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");
|
html.push_str("\n");
|
||||||
self.pre.set_inner_html(&html);
|
self.pre.set_inner_html(&html);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user