Skip to content

Don't escape math on serialization - #115

Merged
Drodt merged 4 commits into
typst:mainfrom
jassielof:str
Aug 30, 2026
Merged

Drodt merged 4 commits into
typst:mainfrom
jassielof:str

Conversation

@jassielof

@jassielof jassielof commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Related to #76, it fixes the math serialization, but the spacing one is still wrong, I added ignored tests for that case, for accents and the math. The spacing stuff I saw it a bit complex as for what correct design to come up with for the solution, so I left it.

@Drodt Drodt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A step in the right direction. Thank you! Just a minor change.

Comment thread src/chunk.rs
/// The `is_verbatim` argument indicates whether this string is intended for
/// a verbatim field like `file` with limited escapes.
pub fn to_biblatex_string(&self, is_verbatim: bool) -> String {
if let Chunk::Math(s) = self {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a reference to #76 here so the code is understandable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it to the new tests too.

@Drodt Drodt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@Drodt
Drodt merged commit 8f973e9 into typst:main Aug 30, 2026
2 checks passed
@jassielof
jassielof deleted the str branch August 30, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants