diff --git a/crates/engine/src/cmd/fileio.rs b/crates/engine/src/cmd/fileio.rs index 9154ce7ee5..d20c6c46b2 100644 --- a/crates/engine/src/cmd/fileio.rs +++ b/crates/engine/src/cmd/fileio.rs @@ -123,7 +123,7 @@ mod formats; #[cfg(not(target_arch = "wasm32"))] pub(crate) use access::list_dir; -pub use access::{write_file_with, write_save_file, write_save_file_with}; +pub use access::{check_linked_scripts, write_file_with, write_save_file, write_save_file_with}; #[cfg(all(test, not(target_arch = "wasm32")))] mod tests_readonly; diff --git a/crates/engine/src/cmd/fileio/access.rs b/crates/engine/src/cmd/fileio/access.rs index 6488972d31..203a2262b0 100644 --- a/crates/engine/src/cmd/fileio/access.rs +++ b/crates/engine/src/cmd/fileio/access.rs @@ -121,6 +121,24 @@ pub(crate) fn naming_in_message(msg: &str, path: &str, name: &str) -> String { out } +/// The error for an SVG of a document that links a JavaScript file outside the read roots. +pub(crate) const SCRIPT_OUTSIDE: &str = "a linked JavaScript file is outside the read roots"; + +/// `cmd` may write `st`'s document in format `format` (a format id): any format but SVG and SVGZ, +/// and those too unless read roots are in force and the document links a JavaScript file outside +/// them (`svg_scripts`, a relative path taken from the document's folder; a URL is not checked), +/// which the file's `