-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust emphasis parser for CJK characters.
Typst documentation says that `*` strong emphasis "only works at word boundaries." However, in typst/typst#2648 this was changed for CJK. Closes #49.
- Loading branch information
Showing
3 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- parse tree --- | ||
[ Code | ||
"test/typ/regression/issue49.typ" | ||
( line 1 , column 2 ) | ||
(Let | ||
(BasicBind (Just (Identifier "test"))) | ||
(FuncExpr | ||
[ NormalParam (Identifier "x") , NormalParam (Identifier "y") ] | ||
(Block | ||
(CodeBlock | ||
[ If | ||
[ ( Equals (Ident (Identifier "x")) (Ident (Identifier "y")) | ||
, Block (Content [ Text "\9989" ]) | ||
) | ||
, ( Literal (Boolean True) | ||
, Block | ||
(Content | ||
[ Text "\10060" | ||
, Text "(" | ||
, Code | ||
"test/typ/regression/issue49.typ" | ||
( line 1 , column 47 ) | ||
(FuncCall | ||
(Ident (Identifier "repr")) | ||
[ NormalArg (Ident (Identifier "x")) ]) | ||
, Space | ||
, Text "/" | ||
, Text "=" | ||
, Space | ||
, Code | ||
"test/typ/regression/issue49.typ" | ||
( line 1 , column 59 ) | ||
(FuncCall | ||
(Ident (Identifier "repr")) | ||
[ NormalArg (Ident (Identifier "y")) ]) | ||
, Text ")" | ||
]) | ||
) | ||
] | ||
])))) | ||
, SoftBreak | ||
, Text "\27979\35797\25991\26412" | ||
, Strong [ Text "\21152\31895" ] | ||
, Text "\12290" | ||
, ParBreak | ||
] | ||
--- evaluated --- | ||
document(body: { text(body: [ | ||
测试文本]), | ||
strong(body: text(body: [加粗])), | ||
text(body: [。]), | ||
parbreak() }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
测试文本*加粗*。 |