Cover image for [Request] RTL Support

[Request] RTL Support

kl13nt profile image Nabil Tharwat ・1 min read

I don't know whether this is already a feature on forem's roadmap, I tried searching and didn't find any posts mentioning RTL.

This issue on GitHub describes the problem briefly. I tried to come up with solutions. Those include:

  • Using dir=auto on user-generated content HTML, leaving the whole rendering and processing to the browser. Per the WHATWG HTML Spec, elements by default have dir=ltr. Adding dir=auto will let the browser determine the directionality of an element based on the first character with a strong directionality in that element. This would require no styling changes AFAICT.
  • Adding a boolean where the author specifies the default direction of their article.
  • Using liquid tags to specify bidi, rtl, and ltr text, defaulting to ltr.
  • Allowing HTML rendering in addition to Markdown and Liquid. This is probably too much.
  • Parsing the content on the server and determining the directionality of each element.

Discussion (0)

Editor guide