From afd538d6af0baf8a1861ff2cdef881edbfb57000 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Wed, 29 Apr 2026 19:55:57 +0200 Subject: feat(): support math content --- typst/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'typst/src') 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) } } -- cgit v1.2.3