Closed jesmarti closed 1 year ago
Also, when navigating to the addon's Config page and selecting the 'Restore Defaults' option, the CSS file (_ch-pygments-solarized.css) is reset. This removes the text-align: left;
, causing the original alignment problem to reappear.
Hi @jesmarti,
Thank you for your detailed ticket.
Your card template has text-align: center;
that's interfering with formatting. Remove it, and your note should work just fine.
Alternatively, you may add text-align: left;
to the block-style config parameter.
Please let me know if that doesn't solve your issue.
Hello @gregorias,
Thanks for your prompt guidance.
Adding text-align: left;
to the block-style config resolved the alignment issue without needing to alter Anki's default center alignment in the Styling section. Your solution is highly effective.
Thanks again for your assistance.
Best regards.
Description:
When formatting code using Pygments > Block, the text is not properly aligned to the left.
Reproduction steps:
Download the addon Add card Choose Basic card type Format code -> Pygments -> Block -> C
Expected behavior:
Text should be aligned to the left side of the block.
Screenshots:
How I manually fixed it:
Opened the _ch-pygments-solarized.css file and added
text-align: left;
under.pygments>pre
Affected field's HTML code:
Card template
Front Template:
Back Template
Styling:
OS Version:
Windows 10
Anki version:
Version 2.1.63 (f356f177) Python 3.9.15 Qt 6.4.3 PyQt 6.4.0