Skip to content

Commit

Permalink
Update md_helper.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
secheng722 committed May 21, 2024
1 parent eb7df58 commit 38cba20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fs_helper/md_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ pub fn render_md_to_html(name: &str) -> Result<MdContent> {
}

pub fn add_catalog_by_upload_file(filename: &str, path: &str) -> Result<()> {
if let Ok(file) = std::fs::File::open(path) {
let md_path = format!("assert/md/{}.md", filename);
if let Ok(_file) = std::fs::File::open(md_path) {
Ok(())
} else if let Ok(file) = std::fs::File::open(path) {
let reader = BufReader::new(file);
let mut lines = reader.lines();
let title = lines.next().unwrap().unwrap();
Expand Down

0 comments on commit 38cba20

Please sign in to comment.