mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
No text hashtags
This commit is contained in:
parent
0ef1b02ee0
commit
e1f2acff62
@ -181,7 +181,7 @@ impl Lexer<'_> {
|
|||||||
'*' if !self.in_word() => SyntaxKind::Star,
|
'*' if !self.in_word() => SyntaxKind::Star,
|
||||||
'_' if !self.in_word() => SyntaxKind::Underscore,
|
'_' if !self.in_word() => SyntaxKind::Underscore,
|
||||||
|
|
||||||
'#' if self.s.at(|c: char| !c.is_whitespace()) => SyntaxKind::Hashtag,
|
'#' => SyntaxKind::Hashtag,
|
||||||
'[' => SyntaxKind::LeftBracket,
|
'[' => SyntaxKind::LeftBracket,
|
||||||
']' => SyntaxKind::RightBracket,
|
']' => SyntaxKind::RightBracket,
|
||||||
'\'' => SyntaxKind::SmartQuote,
|
'\'' => SyntaxKind::SmartQuote,
|
||||||
@ -401,7 +401,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.at(|c: char| !c.is_whitespace()) => SyntaxKind::Hashtag,
|
'#' => SyntaxKind::Hashtag,
|
||||||
'_' => SyntaxKind::Underscore,
|
'_' => SyntaxKind::Underscore,
|
||||||
'$' => SyntaxKind::Dollar,
|
'$' => SyntaxKind::Dollar,
|
||||||
'/' => SyntaxKind::Slash,
|
'/' => SyntaxKind::Slash,
|
||||||
|
@ -485,6 +485,7 @@ fn embedded_code_expr(p: &mut Parser) {
|
|||||||
p.stop_at_newline(true);
|
p.stop_at_newline(true);
|
||||||
p.enter(LexMode::Code);
|
p.enter(LexMode::Code);
|
||||||
p.assert(SyntaxKind::Hashtag);
|
p.assert(SyntaxKind::Hashtag);
|
||||||
|
p.unskip();
|
||||||
|
|
||||||
let stmt = matches!(
|
let stmt = matches!(
|
||||||
p.current(),
|
p.current(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user