Skip to content

Commit

Permalink
Add main function for emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
noClaps committed Jan 2, 2025
1 parent 55f0c51 commit 20cf1e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rustflags = [
"-C",
"link-arg=-sEXPORTED_RUNTIME_METHODS=[\"UTF8ToString\"]",
"-C",
"link-arg=-sEXPORTED_FUNCTIONS=[\"_malloc\",\"_free\"]",
"link-arg=-sEXPORTED_FUNCTIONS=[\"_malloc\",\"_free\",\"_main\"]",
"-C",
"link-arg=-sALLOW_MEMORY_GROWTH=1",
"-C",
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,6 @@ pub fn highlight(highlight_names: Vec<String>, language: String, code: String) -

html_renderer.lines().collect::<Vec<&str>>().join("")
}

#[no_mangle]
pub fn main() {}

0 comments on commit 20cf1e8

Please sign in to comment.