(html: &str, width: u32, height: u32)
| 30 | } |
| 31 | |
| 32 | fn wrap_slide_html(html: &str, width: u32, height: u32) -> String { |
| 33 | let body = html.trim(); |
| 34 | if body.to_ascii_lowercase().starts_with("<!doctype") |
| 35 | || body.to_ascii_lowercase().starts_with("<html") |
| 36 | { |
| 37 | return body.to_string(); |
| 38 | } |
| 39 | format!( |
| 40 | "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><style>html,body{{margin:0;padding:0;width:{width}px;height:{height}px;overflow:hidden;}}</style></head><body>{body}</body></html>" |
| 41 | ) |
| 42 | } |
| 43 | |
| 44 | /// Write slide HTML to app cache and return a `file://` URL for the export webview. |
| 45 | fn file_url_for_export_html<R: tauri::Runtime>( |
no test coverage detected