aboutsummaryrefslogtreecommitdiff
path: root/typst/src/lib.rs
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-29 19:55:57 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-29 19:55:57 +0200
commitafd538d6af0baf8a1861ff2cdef881edbfb57000 (patch)
treedb41d566c318163cb41916defd7cd274b92a9a43 /typst/src/lib.rs
parent0535fa152ae990a28d0b7b9a59e96911074118b8 (diff)
feat(): support math content
Diffstat (limited to 'typst/src/lib.rs')
-rw-r--r--typst/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/typst/src/lib.rs b/typst/src/lib.rs
index 83a0afb..5c2ee0d 100644
--- a/typst/src/lib.rs
+++ b/typst/src/lib.rs
@@ -24,7 +24,7 @@ pub fn compile(content: &str) -> String {
}
pub fn escape_math(content: &str) -> String {
- content.replace("$", r"\$")
+ content.replace("$", r"\$").replace("\n", r"\ ")
}
unsafe fn convert_call(source: *const c_char, f: fn(&str) -> String) -> *const c_char {
@@ -47,6 +47,6 @@ pub unsafe extern "C" fn typst_freeString(res: *mut c_char) {
}
#[unsafe(no_mangle)]
-pub unsafe extern "C" fn typst_espaceMath(source: *const c_char) -> *const c_char {
+pub unsafe extern "C" fn typst_escapeMath(source: *const c_char) -> *const c_char {
unsafe { convert_call(source, escape_math) }
}