-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add conversion for sub/super-script #2
Comments
I vote for the second rule only. The first one needs much more attention to implement and to maintain:
|
In as far as mapping is concerned, I have linked a good one and we can assume nothing changes in the future in the relevant code planes. As to comparison, I though that's actually quite easy: FROM = "..."
TO = "..."
translated = content.translate(str.maketrans(FROM, TO))
if all(src != dst for src, dst in zip(content, translated)):
return content
else:
return f"<sup>{content}</sup>" We have enough cores to not to care about efficiency :) |
Ok, I am ready to exchange efficiency for beautiful and elegant code :) |
👍 |
I can't help thinking this solution will lead me to the unpredictable bugs. I would prefer to implement the simplest solution so that you can extend it as you see fit. |
Fine, I can live with that, thanks! |
We use
^superscript^
and~subscript~
in our projects.Could you please add translation according to the following rules:
<sup>
&<sub>
tagsThanks!
The text was updated successfully, but these errors were encountered: