-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly format en and em dashes in reference titles #17
Conversation
It's a very naive approach that scales as O(B*R) where B is the number of items in the bibliography and R is the number of possible replacements. But maybe we don't expect too many replacements. Certainly there aren't that many text replacements we want to do for titles I think. |
for replacement in tex2unicode_replacements | ||
s = replace(s, replacement) | ||
end | ||
return s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can use multiple pairs in one replace
for replacement in tex2unicode_replacements | |
s = replace(s, replacement) | |
end | |
return s | |
replace(s, tex2unicode_replacements...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woah nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah looks like
replace(A, old_new::Pair...; [count::Integer])
is defined in general but for strings we are stuck with
replace(s::AbstractString, pat=>r; [count::Integer])
😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I just realised. Upstream issue JuliaLang/julia#35327
Co-authored-by: Simon Byrne <simonbyrne@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine by me. Rebase/squash first?
This reverts commit fd865e2.
e2a3a5f
to
da5cdff
Compare
This PR starts adding support for converting common TeX to unicode starting with en and em dashes.
This PR depends on #13.
Resolves #11 (?)