-
Notifications
You must be signed in to change notification settings - Fork 1
markdown export #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
markdown export #61
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for exporting scan reports in Markdown format. The implementation extends the existing export functionality to include Markdown alongside JSON, HTML, and SARIF formats.
Key Changes:
- Added Markdown as a valid output format option
- Implemented Markdown export logic in the blast scanner
- Updated validation to accept "markdown" as a valid format
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/scanners/blast.rs | Implements the Markdown export functionality by fetching and writing the report |
| src/main.rs | Updates command-line help text and format validation to include Markdown |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| else if out_format == "markdown" { | ||
| let report = match utils::api::get_scan_report(&config.get_url(), &config.get_token(), &scan_id, Some("markdown")) { | ||
| Ok(markdown) => markdown, | ||
| Err(e) => { | ||
| eprintln!("\n\nFailed to fetch Markdown report: {}\n\n", e); | ||
| std::process::exit(1); | ||
| } | ||
| }; | ||
| *stop_signal.lock().unwrap() = true; | ||
| let _ = results_thread.join(); | ||
| fs::write(out_file.clone(), report).expect("\n\nFailed to write Markdown file, check if the file path is valid and you have the necessary permissions to write to it."); | ||
| utils::terminal::clear_previous_line(); | ||
| println!("\n\nScan report written to: {}\n\n", out_file.clone()); | ||
| } |
Copilot
AI
Dec 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block duplicates logic from the existing format export blocks. The pattern of fetching the report, stopping the signal, joining the thread, writing the file, and printing the success message is repeated. Consider extracting this common logic into a helper function that takes the format type as a parameter to reduce duplication and improve maintainability.
No description provided.