berkmancenter / tagteam

Enhanced Social Tagging for Academic Communities
http://tagteam.harvard.edu/
GNU Affero General Public License v3.0
94 stars 30 forks source link

Tags containing right-to-left text infect surrounding text with right-to-left-ness #47

Open zackw opened 6 years ago

zackw commented 6 years ago

Consider a tag named "src-page:ar:⁨الحرب الأهلية السورية⁩" The right-to-left (Arabic) text is not properly isolated to the HTML element containing the tag name, so, for instance, on the tag page, the count of items with that tag appears to the left of the Arabic words, inside the tag name:

screenshot from 2018-02-27 13-32-26

(Note: in order to prevent this very bug report from having the same problem, I have inserted Unicode direction isolation characters into the name of the tag. Those do not exist in my actual database.)

The best fix is probably to wrap each tag name in <bdi> ... </bdi> on render. Unicode direction isolation characters would also work, but they're invisible so that might be confusing.