{"action":"created","comment":{"url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/comments/57006172","id":57006172,"diff_hunk":"@@ -0,0 +1,90 @@\n+MathJax.Hub.Config({\n+  'HTML-CSS': {\n+    undefinedFamily: 'Amiri',\n+    styles: {\n+      '.mfliph': {\n+        'display': 'inline-block !important',\n+        '-moz-transform': 'scaleX(-1)',\n+        '-webkit-transform': 'scaleX(-1)',\n+        '-o-transform': 'scaleX(-1)',\n+        'transform': 'scaleX(-1)',\n+        '-ms-filter': 'fliph',\n+        'filter': 'fliph'\n+      },\n+      '.mar': {\n+        'font-family': 'Amiri !important',\n+        'font-style': 'normal !important'\n+      }\n+    }\n+  }\n+});\n+\n+\n+MathJax.Hub.Register.StartupHook('mml Jax Ready', function () {\n+  MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready', function () {\n+    MathJax.Hub.Register.StartupHook('Arabic TeX Ready', function () {\n+      var MML = MathJax.ElementJax.mml;\n+\n+      var flipHorizontalElement = function (token, element) {\n+        var className = '';\n+\n+        if ('ar' === token.Get('fontLang')) {","path":"arabic/unpacked/html.js","position":31,"original_position":31,"commit_id":"e9dc9fd93e0c7d952850191f310297483ff88b1e","original_commit_id":"e9dc9fd93e0c7d952850191f310297483ff88b1e","user":{"login":"dpvc","id":432782,"avatar_url":"https://avatars.githubusercontent.com/u/432782?v=3","gravatar_id":"","url":"https://api.github.com/users/dpvc","html_url":"https://github.com/dpvc","followers_url":"https://api.github.com/users/dpvc/followers","following_url":"https://api.github.com/users/dpvc/following{/other_user}","gists_url":"https://api.github.com/users/dpvc/gists{/gist_id}","starred_url":"https://api.github.com/users/dpvc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpvc/subscriptions","organizations_url":"https://api.github.com/users/dpvc/orgs","repos_url":"https://api.github.com/users/dpvc/repos","events_url":"https://api.github.com/users/dpvc/events{/privacy}","received_events_url":"https://api.github.com/users/dpvc/received_events","type":"User","site_admin":false},"body":"The `Get()` method is used to handle inheritance of properties via `<mstyle>` and other elements that affect their children.  It looks like your `fontLang` and `fliph` properties are only used on the elements themselves (not inherited), so there is no need to go through the overhead of `Get()`.  Just use `token.fontLang` and `token.fliph` directly.\r\n\r\nAlso, there is a convention that if you add properties or methods to the base MML classes, that you use a name prefix so help avoid potential conflicts with other extensions.  So using something like `arabicFontLang` and `arabicFlipH` or something like that would be the normal way to do this.  (I haven't been as careful about this as I should have, and a number of extensions don't do this, but we're trying to be more rigorous about it with new code.)","created_at":"2016-03-22T15:24:31Z","updated_at":"2016-03-22T15:24:31Z","html_url":"https://github.com/mathjax/MathJax-third-party-extensions/pull/20#discussion_r57006172","pull_request_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/comments/57006172"},"html":{"href":"https://github.com/mathjax/MathJax-third-party-extensions/pull/20#discussion_r57006172"},"pull_request":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20","id":54468589,"html_url":"https://github.com/mathjax/MathJax-third-party-extensions/pull/20","diff_url":"https://github.com/mathjax/MathJax-third-party-extensions/pull/20.diff","patch_url":"https://github.com/mathjax/MathJax-third-party-extensions/pull/20.patch","issue_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues/20","number":20,"state":"open","locked":false,"title":"(WIP) Adding Arabic-specific RTL to MathJax","user":{"login":"OmarIthawi","id":645156,"avatar_url":"https://avatars.githubusercontent.com/u/645156?v=3","gravatar_id":"","url":"https://api.github.com/users/OmarIthawi","html_url":"https://github.com/OmarIthawi","followers_url":"https://api.github.com/users/OmarIthawi/followers","following_url":"https://api.github.com/users/OmarIthawi/following{/other_user}","gists_url":"https://api.github.com/users/OmarIthawi/gists{/gist_id}","starred_url":"https://api.github.com/users/OmarIthawi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OmarIthawi/subscriptions","organizations_url":"https://api.github.com/users/OmarIthawi/orgs","repos_url":"https://api.github.com/users/OmarIthawi/repos","events_url":"https://api.github.com/users/OmarIthawi/events{/privacy}","received_events_url":"https://api.github.com/users/OmarIthawi/received_events","type":"User","site_admin":false},"body":"This pull request will be updated to get the Arabic MathJax solution from the [original hack](https://github.com/Edraak/MathJax/blob/bfb43be34c2572e8c356d8934a2fdd77de3926a7/README.md).\r\n\r\nIn this pull request the following will be done:\r\n\r\n - [x] Convert the hack into a reusable `Contrib` extension\r\n\r\n - [x] Split into three (or more) modules\r\n   - Making the TeX jax RTL aware and allow defining lang-dependent commands\r\n   - Making the HTML-CSS jax renders RTL well\r\n   - Add Math-specific language-depedents units to the TeX\r\n   - Add Physics-specific language-depedents units to the TeX\r\n\r\n - [x] Make the language detection mechanism configurable for the `\\ar` command. \r\n        Note: Now it is hard-coded in the the lang attribute of the <html> tag.\r\n \r\n - [x] Support the **Limit** `\\lim` (Unlike `\\sum` and `\\int`, this requires a completely different drawing)\r\n\r\n\r\nI will not try to make a one-size fits all RTL solution, instead I will try to do the following:\r\n\r\n - Essential RTL support for Arabic\r\n - Arabic support through custom font (basic font support for now)\r\n - Localized physics units, variables, constants and others\r\n - Make the solution as modular as possible to make future expansions for other language possible","created_at":"2015-12-23T13:20:48Z","updated_at":"2016-03-22T15:24:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c2bfb2b188e20108a169be078921480f7208413","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20/commits","review_comments_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20/comments","review_comment_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues/20/comments","statuses_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/statuses/e9dc9fd93e0c7d952850191f310297483ff88b1e","head":{"label":"Edraak:arabic-extension","ref":"arabic-extension","sha":"e9dc9fd93e0c7d952850191f310297483ff88b1e","user":{"login":"Edraak","id":8113497,"avatar_url":"https://avatars.githubusercontent.com/u/8113497?v=3","gravatar_id":"","url":"https://api.github.com/users/Edraak","html_url":"https://github.com/Edraak","followers_url":"https://api.github.com/users/Edraak/followers","following_url":"https://api.github.com/users/Edraak/following{/other_user}","gists_url":"https://api.github.com/users/Edraak/gists{/gist_id}","starred_url":"https://api.github.com/users/Edraak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Edraak/subscriptions","organizations_url":"https://api.github.com/users/Edraak/orgs","repos_url":"https://api.github.com/users/Edraak/repos","events_url":"https://api.github.com/users/Edraak/events{/privacy}","received_events_url":"https://api.github.com/users/Edraak/received_events","type":"Organization","site_admin":false},"repo":{"id":48491129,"name":"MathJax-third-party-extensions","full_name":"Edraak/MathJax-third-party-extensions","owner":{"login":"Edraak","id":8113497,"avatar_url":"https://avatars.githubusercontent.com/u/8113497?v=3","gravatar_id":"","url":"https://api.github.com/users/Edraak","html_url":"https://github.com/Edraak","followers_url":"https://api.github.com/users/Edraak/followers","following_url":"https://api.github.com/users/Edraak/following{/other_user}","gists_url":"https://api.github.com/users/Edraak/gists{/gist_id}","starred_url":"https://api.github.com/users/Edraak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Edraak/subscriptions","organizations_url":"https://api.github.com/users/Edraak/orgs","repos_url":"https://api.github.com/users/Edraak/repos","events_url":"https://api.github.com/users/Edraak/events{/privacy}","received_events_url":"https://api.github.com/users/Edraak/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Edraak/MathJax-third-party-extensions","description":"A collection of MathJax extensions provided by third-party contributors","fork":true,"url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions","forks_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/forks","keys_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/teams","hooks_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/hooks","issue_events_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/issues/events{/number}","events_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/events","assignees_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/assignees{/user}","branches_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/branches{/branch}","tags_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/tags","blobs_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/languages","stargazers_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/stargazers","contributors_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/contributors","subscribers_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/subscribers","subscription_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/subscription","commits_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/contents/{+path}","compare_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/merges","archive_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/downloads","issues_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/issues{/number}","pulls_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/labels{/name}","releases_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/releases{/id}","deployments_url":"https://api.github.com/repos/Edraak/MathJax-third-party-extensions/deployments","created_at":"2015-12-23T13:09:09Z","updated_at":"2015-12-23T13:09:10Z","pushed_at":"2016-03-07T07:38:47Z","git_url":"git://github.com/Edraak/MathJax-third-party-extensions.git","ssh_url":"git@github.com:Edraak/MathJax-third-party-extensions.git","clone_url":"https://github.com/Edraak/MathJax-third-party-extensions.git","svn_url":"https://github.com/Edraak/MathJax-third-party-extensions","homepage":null,"size":280,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mathjax:master","ref":"master","sha":"68e5bcab60cd16e69103921c44a6052cad6f262f","user":{"login":"mathjax","id":252187,"avatar_url":"https://avatars.githubusercontent.com/u/252187?v=3","gravatar_id":"","url":"https://api.github.com/users/mathjax","html_url":"https://github.com/mathjax","followers_url":"https://api.github.com/users/mathjax/followers","following_url":"https://api.github.com/users/mathjax/following{/other_user}","gists_url":"https://api.github.com/users/mathjax/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjax/subscriptions","organizations_url":"https://api.github.com/users/mathjax/orgs","repos_url":"https://api.github.com/users/mathjax/repos","events_url":"https://api.github.com/users/mathjax/events{/privacy}","received_events_url":"https://api.github.com/users/mathjax/received_events","type":"Organization","site_admin":false},"repo":{"id":10687227,"name":"MathJax-third-party-extensions","full_name":"mathjax/MathJax-third-party-extensions","owner":{"login":"mathjax","id":252187,"avatar_url":"https://avatars.githubusercontent.com/u/252187?v=3","gravatar_id":"","url":"https://api.github.com/users/mathjax","html_url":"https://github.com/mathjax","followers_url":"https://api.github.com/users/mathjax/followers","following_url":"https://api.github.com/users/mathjax/following{/other_user}","gists_url":"https://api.github.com/users/mathjax/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjax/subscriptions","organizations_url":"https://api.github.com/users/mathjax/orgs","repos_url":"https://api.github.com/users/mathjax/repos","events_url":"https://api.github.com/users/mathjax/events{/privacy}","received_events_url":"https://api.github.com/users/mathjax/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mathjax/MathJax-third-party-extensions","description":"A collection of MathJax extensions provided by third-party contributors","fork":false,"url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions","forks_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/forks","keys_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/teams","hooks_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/hooks","issue_events_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues/events{/number}","events_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/events","assignees_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/assignees{/user}","branches_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/branches{/branch}","tags_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/tags","blobs_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/languages","stargazers_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/stargazers","contributors_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/contributors","subscribers_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/subscribers","subscription_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/subscription","commits_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/contents/{+path}","compare_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/merges","archive_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/downloads","issues_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues{/number}","pulls_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/labels{/name}","releases_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/releases{/id}","deployments_url":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/deployments","created_at":"2013-06-14T11:02:28Z","updated_at":"2016-03-05T10:58:07Z","pushed_at":"2016-03-13T02:15:19Z","git_url":"git://github.com/mathjax/MathJax-third-party-extensions.git","ssh_url":"git@github.com:mathjax/MathJax-third-party-extensions.git","clone_url":"https://github.com/mathjax/MathJax-third-party-extensions.git","svn_url":"https://github.com/mathjax/MathJax-third-party-extensions","homepage":null,"size":596,"stargazers_count":17,"watchers_count":17,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":8,"forks":10,"open_issues":8,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20"},"html":{"href":"https://github.com/mathjax/MathJax-third-party-extensions/pull/20"},"issue":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues/20"},"comments":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/mathjax/MathJax-third-party-extensions/statuses/e9dc9fd93e0c7d952850191f310297483ff88b1e"}}}}