this repo has no description

0.3.8 - Use Vec<char> instead of &str to correctly parse Chinese character.

Signed-off-by: Jamie Moriarty <jamiemoriarty@qq.com>

+10 -6
+1 -1
Cargo.lock
··· 48 48 49 49 [[package]] 50 50 name = "tex2typst-rs" 51 - version = "0.3.7" 51 + version = "0.3.8" 52 52 dependencies = [ 53 53 "regex", 54 54 ]
+1 -1
Cargo.toml
··· 1 1 [package] 2 2 name = "tex2typst-rs" 3 - version = "0.3.7" 3 + version = "0.3.8" 4 4 description = "Converts LaTeX math to Typst math" 5 5 authors = ["Jamie <bdmundxyang@gmail.com>"] 6 6 license = "GPL-3.0-or-later"
+8 -4
src/tests.rs
··· 2 2 3 3 #[cfg(test)] 4 4 mod tests { 5 + use crate::{converter, tex2typst, tex2typst_with_macros, tex_parser, text_and_tex2typst, typst_writer}; 5 6 use std::collections::HashMap; 6 7 use std::error::Error; 7 8 use std::result; 8 - use crate::{converter, tex2typst, tex2typst_with_macros, tex_parser, text_and_tex2typst, typst_writer}; 9 9 10 10 #[test] 11 11 fn simple_test() { ··· 74 74 75 75 #[test] 76 76 fn test_cn_chars() { 77 - let tex = r"\text{中文}"; 77 + let tex = r"\begin{aligned} 78 + (f+g)(s) & =f(s)+g(s), \quad \forall f, g \in \mathcal{F}, s \in S ; \\ 79 + (\alpha f)(s) & =\alpha f(s), \quad \forall f \in \mathcal{F}, s \in S, \alpha \text { 是数. } 80 + \end{aligned}"; 78 81 let result = tex2typst(tex).unwrap(); 79 - assert_eq!(result, "\"中文\""); 82 + dbg!(result); 80 83 } 81 84 82 85 #[test] 83 86 fn test_readme() { 84 - let tex = r"\widehat{f}(\xi)=\int_{-\infty}^{\infty} f(x) e^{-i 2 \pi \xi x} d x, \quad \forall \xi \in \mathbb{R}"; 87 + let tex = 88 + r"\widehat{f}(\xi)=\int_{-\infty}^{\infty} f(x) e^{-i 2 \pi \xi x} d x, \quad \forall \xi \in \mathbb{R}"; 85 89 println!("{}", tex2typst(tex).unwrap()); 86 90 87 91 let mixed = r"some text and some formula: \(\frac{1}{2}\)";