-
Notifications
You must be signed in to change notification settings - Fork 122
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
🐛 Bug - Missing underline character for emojis #626
Comments
Many thanks Jacob for the report. If you have time, please consider creating a PR with a fix for this. I am happy to review and merge the fix. It looks like this is an issue with jinja From what I can see, the code generating the underlines is in the jinja template
|
Updated I took a closer look. The length for But I can see that RST fails to compile https://rsted.info.ucl.ac.be/?theme=basic&n=946cb83fa878e973dd24ee1763b292e0 :( |
Think I might be seeing something now. When using the Python interpreter in my console I see the following output when using an emoji: $ python
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> len("�� Bugfixes")
10
>>> len("~~~~~~~~~~")
10
>>> len(" Bugfixes")
9 Looking like the issue lies with encoding. In the console it shows 11 characters, but Python3 using utf-8 is able to interpret 10 characters. Note that "��" = 🐛 |
I think that the issue is with docutils. There is this upstream bug report https://sourceforge.net/p/docutils/bugs/335/ which suggest that docutils doesn't think that this is an issue :( so it looks like we need to fix it in On my Python 3.12 I can see that this is recognized as wide ... so docutils requires extra underlines
I think that we might need a helper function / filter for jinja to calculate the underline size |
One option is to add an extra
|
Opened PR #645 to resolve this |
Whenever running the
towncrier
command for my release notes, the changelog.rst file that's generated for it is missing an underline for every emoji character that's used.pyproject.toml setting looks as such:
changelog.rst looks as such:
🐛 Bugfixes ~~~~~~~~~~
The text was updated successfully, but these errors were encountered: