{"action":"created","issue":{"url":"https://api.github.com/repos/jgm/pandoc/issues/2191","labels_url":"https://api.github.com/repos/jgm/pandoc/issues/2191/labels{/name}","comments_url":"https://api.github.com/repos/jgm/pandoc/issues/2191/comments","events_url":"https://api.github.com/repos/jgm/pandoc/issues/2191/events","html_url":"https://github.com/jgm/pandoc/issues/2191","id":82330465,"number":2191,"title":"Write filter to support right-to-left direction in Persian text. ","user":{"login":"khajavi","id":235974,"avatar_url":"https://avatars.githubusercontent.com/u/235974?v=3","gravatar_id":"","url":"https://api.github.com/users/khajavi","html_url":"https://github.com/khajavi","followers_url":"https://api.github.com/users/khajavi/followers","following_url":"https://api.github.com/users/khajavi/following{/other_user}","gists_url":"https://api.github.com/users/khajavi/gists{/gist_id}","starred_url":"https://api.github.com/users/khajavi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khajavi/subscriptions","organizations_url":"https://api.github.com/users/khajavi/orgs","repos_url":"https://api.github.com/users/khajavi/repos","events_url":"https://api.github.com/users/khajavi/events{/privacy}","received_events_url":"https://api.github.com/users/khajavi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-05-29T08:27:32Z","updated_at":"2015-08-22T18:41:02Z","closed_at":null,"body":"I need to convert the Persian text like this:\r\n\r\n```markdown\r\n# عنوان اول\r\nاین متن فارسی باید راست به چپ نشان داده شود.\r\n\r\nThis is the English paragraph, so it's direction in html should be left-to-right.\r\n```\r\n To HTML like this:\r\n\r\n```html\r\n<h1 dir=\"rtl\">عنوان اول</h1>\r\n<p dir=\"rtl\">این متن فارسی باید راست به چپ نشان داده شود.</p>\r\n<p>This is the English paragraph, so it's direction in html should be left-to-right.</p>\r\n```\r\n\r\nAny one could help me how can I write proper Pandoc filter in Haskell to solve this problem?"},"comment":{"url":"https://api.github.com/repos/jgm/pandoc/issues/comments/133739077","html_url":"https://github.com/jgm/pandoc/issues/2191#issuecomment-133739077","issue_url":"https://api.github.com/repos/jgm/pandoc/issues/2191","id":133739077,"user":{"login":"mb21","id":157497,"avatar_url":"https://avatars.githubusercontent.com/u/157497?v=3","gravatar_id":"","url":"https://api.github.com/users/mb21","html_url":"https://github.com/mb21","followers_url":"https://api.github.com/users/mb21/followers","following_url":"https://api.github.com/users/mb21/following{/other_user}","gists_url":"https://api.github.com/users/mb21/gists{/gist_id}","starred_url":"https://api.github.com/users/mb21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mb21/subscriptions","organizations_url":"https://api.github.com/users/mb21/orgs","repos_url":"https://api.github.com/users/mb21/repos","events_url":"https://api.github.com/users/mb21/events{/privacy}","received_events_url":"https://api.github.com/users/mb21/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T18:41:01Z","updated_at":"2015-08-22T18:41:01Z","body":"As I said over at [commonmark discuss](http://talk.commonmark.org/t/explicit-rtl-indication-in-pure-markdown/286/9), I think we should be fine with supporting `span`s and `div`s with `dir` attributes.\r\n\r\nIn ConTeXt, we can use `\\righttoleft{my span content}`, `\\startalignment[righttoleft] my div content \\stopalignment` and `\\setupalign[righttoleft]` for the base direction of the document.\r\n\r\nWhen using the `bidi` package (which only works for XeLaTeX as far as I know), they are `\\RL`, `setRL` and `\\usepackage[RTLdocument]{bidi}` respectively.\r\n\r\nSo what about pdfLaTeX and LuaLaTeX? I guess we can forget about the former, but it would be good if we could output the same commands for both Lua- and XeLaTeX. Maybe we can redefine it somehow in our LaTeX template—that is if there is a general purpose rtl/bidi package for LuaLaTex (not only arabic or only farsi), is there? Otherwise, we'll just have to tell people to use either XeLaTeX or ConTeXt. Maybe @khaledhosny can shed some light on these questions, please? :)"}}