mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
Small fixes
This commit is contained in:
parent
4653ffebb4
commit
33585d9a3f
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -1094,6 +1094,7 @@ dependencies = [
|
|||||||
"flate2",
|
"flate2",
|
||||||
"if_chain",
|
"if_chain",
|
||||||
"image",
|
"image",
|
||||||
|
"log",
|
||||||
"miniz_oxide 0.5.4",
|
"miniz_oxide 0.5.4",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pdf-writer",
|
"pdf-writer",
|
||||||
|
@ -19,6 +19,7 @@ comemo = { git = "https://github.com/typst/comemo" }
|
|||||||
flate2 = "1"
|
flate2 = "1"
|
||||||
if_chain = "1"
|
if_chain = "1"
|
||||||
image = { version = "0.24", default-features = false, features = ["png", "jpeg", "gif"] }
|
image = { version = "0.24", default-features = false, features = ["png", "jpeg", "gif"] }
|
||||||
|
log = "0.4"
|
||||||
miniz_oxide = "0.5"
|
miniz_oxide = "0.5"
|
||||||
once_cell = "1"
|
once_cell = "1"
|
||||||
pdf-writer = "0.6"
|
pdf-writer = "0.6"
|
||||||
|
@ -31,7 +31,7 @@ impl VecNode {
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// #set vec(delim: "[")
|
/// #set math.vec(delim: "[")
|
||||||
/// $ vec(1, 2) $
|
/// $ vec(1, 2) $
|
||||||
/// ```
|
/// ```
|
||||||
pub const DELIM: Delimiter = Delimiter::Paren;
|
pub const DELIM: Delimiter = Delimiter::Paren;
|
||||||
|
@ -56,6 +56,7 @@ pub fn module() -> Module {
|
|||||||
math.def_func::<FloorFunc>("floor");
|
math.def_func::<FloorFunc>("floor");
|
||||||
math.def_func::<CeilFunc>("ceil");
|
math.def_func::<CeilFunc>("ceil");
|
||||||
math.def_func::<AbsFunc>("abs");
|
math.def_func::<AbsFunc>("abs");
|
||||||
|
math.def_func::<NormFunc>("norm");
|
||||||
math.def_func::<AccentNode>("accent");
|
math.def_func::<AccentNode>("accent");
|
||||||
math.def_func::<FracNode>("frac");
|
math.def_func::<FracNode>("frac");
|
||||||
math.def_func::<BinomNode>("binom");
|
math.def_func::<BinomNode>("binom");
|
||||||
|
@ -37,7 +37,7 @@ impl LayoutMath for SqrtNode {
|
|||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// $ radical(3, x) $
|
/// $ root(3, x) $
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## Parameters
|
/// ## Parameters
|
||||||
|
@ -191,6 +191,13 @@ pub fn highlight(node: &LinkedNode) -> Option<Category> {
|
|||||||
| SyntaxKind::Frac,
|
| SyntaxKind::Frac,
|
||||||
) => Some(Category::Interpolated),
|
) => Some(Category::Interpolated),
|
||||||
Some(SyntaxKind::FuncCall) => Some(Category::Function),
|
Some(SyntaxKind::FuncCall) => Some(Category::Function),
|
||||||
|
Some(SyntaxKind::FieldAccess)
|
||||||
|
if node.parent().and_then(|p| p.parent_kind())
|
||||||
|
== Some(SyntaxKind::SetRule)
|
||||||
|
&& node.next_sibling().is_none() =>
|
||||||
|
{
|
||||||
|
Some(Category::Function)
|
||||||
|
}
|
||||||
Some(SyntaxKind::FieldAccess)
|
Some(SyntaxKind::FieldAccess)
|
||||||
if node
|
if node
|
||||||
.parent()
|
.parent()
|
||||||
|
@ -429,6 +429,7 @@ impl Lexer<'_> {
|
|||||||
'-' if self.s.eat_if('>') => SyntaxKind::Shorthand,
|
'-' if self.s.eat_if('>') => SyntaxKind::Shorthand,
|
||||||
'=' if self.s.eat_if('>') => SyntaxKind::Shorthand,
|
'=' if self.s.eat_if('>') => SyntaxKind::Shorthand,
|
||||||
':' if self.s.eat_if('=') => SyntaxKind::Shorthand,
|
':' if self.s.eat_if('=') => SyntaxKind::Shorthand,
|
||||||
|
'.' if self.s.eat_if("..") => SyntaxKind::Shorthand,
|
||||||
|
|
||||||
'_' => SyntaxKind::Underscore,
|
'_' => SyntaxKind::Underscore,
|
||||||
'$' => SyntaxKind::Dollar,
|
'$' => SyntaxKind::Dollar,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user