diff --git a/crates/engine/src/cmd/fileio.rs b/crates/engine/src/cmd/fileio.rs index d8c9074001..6817f28b35 100644 --- a/crates/engine/src/cmd/fileio.rs +++ b/crates/engine/src/cmd/fileio.rs @@ -129,9 +129,9 @@ mod commands; mod export_names; mod formats; -pub(crate) use access::check_images_in; #[cfg(not(target_arch = "wasm32"))] pub(crate) use access::list_dir; +pub(crate) use access::{check_images_in, check_scripts_of}; pub use access::{check_linked_images, check_linked_scripts, write_file_with, write_save_file, write_save_file_with}; #[cfg(all(test, not(target_arch = "wasm32")))] diff --git a/crates/engine/src/cmd/fileio/access.rs b/crates/engine/src/cmd/fileio/access.rs index 856656f564..9d2d9a4a33 100644 --- a/crates/engine/src/cmd/fileio/access.rs +++ b/crates/engine/src/cmd/fileio/access.rs @@ -121,22 +121,54 @@ 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. +/// The error for a file that would name a JavaScript file the document links 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 `