Add dir="auto" to cards for stable card direction
#19472
Closed
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose / Description
Currently, the direction in which a card is rendered is not stable by default. If the UI of Ankidroid is English, text direction is left-to-right by default. If the UI of Ankidroidis Arabic, text direction is right-to-left by default. Although this can be changed from the settings (changing css for example), the card direction should be stable by default, being viewed in the same way regardless of the direction of the UI.
Fixes
This commit makes the direction of cards stable, regardless of the UI language.
Approach
This commit attempts to solve the issue by adding
dir="auto"by default for all cards. It will not break existing cards that override the direction via css or html, but it will make cards that don't specify a direction stable.How Has This Been Tested?
I haven't built Ankidroid, but I tested adding this attribute to card template front and back and it worked correctly, making the card direction stable regardless of the UI language.