{"action":"created","comment":{"url":"https://api.github.com/repos/django-wiki/django-wiki/pulls/comments/67622549","id":67622549,"diff_hunk":"@@ -0,0 +1,41 @@\n+from __future__ import absolute_import, unicode_literals\n+\n+import markdown\n+from markdown.util import etree\n+from markdown.treeprocessors import Treeprocessor\n+\n+\n+class ResponsiveTableExtension(markdown.Extension):\n+    \"\"\"Wraps all tables with Bootstrap's table-responsive class\"\"\"\n+\n+    def extendMarkdown(self, md, md_globals):\n+        md.treeprocessors.add('responsivetable', ResponsiveTableTree(md), \"_end\")\n+\n+\n+class ResponsiveTableTree(Treeprocessor):\n+    def run(self, root):\n+        for table_wrapper in list(root.getiterator('table')):\n+            table_new = self.create_table_element()\n+            self.convert_to_wrapper(table_wrapper)\n+            self.move_children(table_wrapper, table_new)","path":"wiki/core/markdown/mdx/responsivetable.py","position":20,"original_position":20,"commit_id":"63635368531d22468019d7afc60d5edc076f427b","original_commit_id":"63635368531d22468019d7afc60d5edc076f427b","user":{"login":"duvholt","id":1637715,"avatar_url":"https://avatars.githubusercontent.com/u/1637715?v=3","gravatar_id":"","url":"https://api.github.com/users/duvholt","html_url":"https://github.com/duvholt","followers_url":"https://api.github.com/users/duvholt/followers","following_url":"https://api.github.com/users/duvholt/following{/other_user}","gists_url":"https://api.github.com/users/duvholt/gists{/gist_id}","starred_url":"https://api.github.com/users/duvholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duvholt/subscriptions","organizations_url":"https://api.github.com/users/duvholt/orgs","repos_url":"https://api.github.com/users/duvholt/repos","events_url":"https://api.github.com/users/duvholt/events{/privacy}","received_events_url":"https://api.github.com/users/duvholt/received_events","type":"User","site_admin":false},"body":"I can't think of a case where it would. \r\n\r\nThe logic is like this: \r\n\r\n- Create new table element\r\n- Move children (thead, tbody) from old table to new table\r\n- Append new table to old table\r\n- Rename old table tag to div and add Bootstrap class\r\n\r\nIt's done this way to preserve parent and children of the table.\r\nThere might be better ways to add elements in the middle of an ElementTree, but I couldn't find any.\r\n","created_at":"2016-06-19T19:32:53Z","updated_at":"2016-06-19T19:32:53Z","html_url":"https://github.com/django-wiki/django-wiki/pull/552#discussion_r67622549","pull_request_url":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552","_links":{"self":{"href":"https://api.github.com/repos/django-wiki/django-wiki/pulls/comments/67622549"},"html":{"href":"https://github.com/django-wiki/django-wiki/pull/552#discussion_r67622549"},"pull_request":{"href":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552"}}},"pull_request":{"url":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552","id":74369661,"html_url":"https://github.com/django-wiki/django-wiki/pull/552","diff_url":"https://github.com/django-wiki/django-wiki/pull/552.diff","patch_url":"https://github.com/django-wiki/django-wiki/pull/552.patch","issue_url":"https://api.github.com/repos/django-wiki/django-wiki/issues/552","number":552,"state":"open","locked":false,"title":"Responsive tables","user":{"login":"duvholt","id":1637715,"avatar_url":"https://avatars.githubusercontent.com/u/1637715?v=3","gravatar_id":"","url":"https://api.github.com/users/duvholt","html_url":"https://github.com/duvholt","followers_url":"https://api.github.com/users/duvholt/followers","following_url":"https://api.github.com/users/duvholt/following{/other_user}","gists_url":"https://api.github.com/users/duvholt/gists{/gist_id}","starred_url":"https://api.github.com/users/duvholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duvholt/subscriptions","organizations_url":"https://api.github.com/users/duvholt/orgs","repos_url":"https://api.github.com/users/duvholt/repos","events_url":"https://api.github.com/users/duvholt/events{/privacy}","received_events_url":"https://api.github.com/users/duvholt/received_events","type":"User","site_admin":false},"body":"Fixes #403\r\n\r\nWrap all markdown tables with `<div class=\"table-responsive\">`.\r\nI included a simple test.","created_at":"2016-06-19T17:57:32Z","updated_at":"2016-06-19T19:32:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"14286475af8041344fef4383e5005622f00580bd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552/commits","review_comments_url":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552/comments","review_comment_url":"https://api.github.com/repos/django-wiki/django-wiki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django-wiki/django-wiki/issues/552/comments","statuses_url":"https://api.github.com/repos/django-wiki/django-wiki/statuses/63635368531d22468019d7afc60d5edc076f427b","head":{"label":"duvholt:responsive-tables","ref":"responsive-tables","sha":"63635368531d22468019d7afc60d5edc076f427b","user":{"login":"duvholt","id":1637715,"avatar_url":"https://avatars.githubusercontent.com/u/1637715?v=3","gravatar_id":"","url":"https://api.github.com/users/duvholt","html_url":"https://github.com/duvholt","followers_url":"https://api.github.com/users/duvholt/followers","following_url":"https://api.github.com/users/duvholt/following{/other_user}","gists_url":"https://api.github.com/users/duvholt/gists{/gist_id}","starred_url":"https://api.github.com/users/duvholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duvholt/subscriptions","organizations_url":"https://api.github.com/users/duvholt/orgs","repos_url":"https://api.github.com/users/duvholt/repos","events_url":"https://api.github.com/users/duvholt/events{/privacy}","received_events_url":"https://api.github.com/users/duvholt/received_events","type":"User","site_admin":false},"repo":{"id":26241913,"name":"django-wiki","full_name":"duvholt/django-wiki","owner":{"login":"duvholt","id":1637715,"avatar_url":"https://avatars.githubusercontent.com/u/1637715?v=3","gravatar_id":"","url":"https://api.github.com/users/duvholt","html_url":"https://github.com/duvholt","followers_url":"https://api.github.com/users/duvholt/followers","following_url":"https://api.github.com/users/duvholt/following{/other_user}","gists_url":"https://api.github.com/users/duvholt/gists{/gist_id}","starred_url":"https://api.github.com/users/duvholt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duvholt/subscriptions","organizations_url":"https://api.github.com/users/duvholt/orgs","repos_url":"https://api.github.com/users/duvholt/repos","events_url":"https://api.github.com/users/duvholt/events{/privacy}","received_events_url":"https://api.github.com/users/duvholt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/duvholt/django-wiki","description":"A wiki system with complex functionality for simple integration and a superb interface. Store your knowledge with style: Use django models.","fork":true,"url":"https://api.github.com/repos/duvholt/django-wiki","forks_url":"https://api.github.com/repos/duvholt/django-wiki/forks","keys_url":"https://api.github.com/repos/duvholt/django-wiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/duvholt/django-wiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/duvholt/django-wiki/teams","hooks_url":"https://api.github.com/repos/duvholt/django-wiki/hooks","issue_events_url":"https://api.github.com/repos/duvholt/django-wiki/issues/events{/number}","events_url":"https://api.github.com/repos/duvholt/django-wiki/events","assignees_url":"https://api.github.com/repos/duvholt/django-wiki/assignees{/user}","branches_url":"https://api.github.com/repos/duvholt/django-wiki/branches{/branch}","tags_url":"https://api.github.com/repos/duvholt/django-wiki/tags","blobs_url":"https://api.github.com/repos/duvholt/django-wiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/duvholt/django-wiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/duvholt/django-wiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/duvholt/django-wiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/duvholt/django-wiki/statuses/{sha}","languages_url":"https://api.github.com/repos/duvholt/django-wiki/languages","stargazers_url":"https://api.github.com/repos/duvholt/django-wiki/stargazers","contributors_url":"https://api.github.com/repos/duvholt/django-wiki/contributors","subscribers_url":"https://api.github.com/repos/duvholt/django-wiki/subscribers","subscription_url":"https://api.github.com/repos/duvholt/django-wiki/subscription","commits_url":"https://api.github.com/repos/duvholt/django-wiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/duvholt/django-wiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/duvholt/django-wiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/duvholt/django-wiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/duvholt/django-wiki/contents/{+path}","compare_url":"https://api.github.com/repos/duvholt/django-wiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/duvholt/django-wiki/merges","archive_url":"https://api.github.com/repos/duvholt/django-wiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/duvholt/django-wiki/downloads","issues_url":"https://api.github.com/repos/duvholt/django-wiki/issues{/number}","pulls_url":"https://api.github.com/repos/duvholt/django-wiki/pulls{/number}","milestones_url":"https://api.github.com/repos/duvholt/django-wiki/milestones{/number}","notifications_url":"https://api.github.com/repos/duvholt/django-wiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/duvholt/django-wiki/labels{/name}","releases_url":"https://api.github.com/repos/duvholt/django-wiki/releases{/id}","deployments_url":"https://api.github.com/repos/duvholt/django-wiki/deployments","created_at":"2014-11-05T22:06:21Z","updated_at":"2015-01-28T18:26:00Z","pushed_at":"2016-06-19T17:55:31Z","git_url":"git://github.com/duvholt/django-wiki.git","ssh_url":"git@github.com:duvholt/django-wiki.git","clone_url":"https://github.com/duvholt/django-wiki.git","svn_url":"https://github.com/duvholt/django-wiki","homepage":"","size":6604,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"django-wiki:master","ref":"master","sha":"1d72a7935c39295b8d89531283caae1f0e86c587","user":{"login":"django-wiki","id":7289936,"avatar_url":"https://avatars.githubusercontent.com/u/7289936?v=3","gravatar_id":"","url":"https://api.github.com/users/django-wiki","html_url":"https://github.com/django-wiki","followers_url":"https://api.github.com/users/django-wiki/followers","following_url":"https://api.github.com/users/django-wiki/following{/other_user}","gists_url":"https://api.github.com/users/django-wiki/gists{/gist_id}","starred_url":"https://api.github.com/users/django-wiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-wiki/subscriptions","organizations_url":"https://api.github.com/users/django-wiki/orgs","repos_url":"https://api.github.com/users/django-wiki/repos","events_url":"https://api.github.com/users/django-wiki/events{/privacy}","received_events_url":"https://api.github.com/users/django-wiki/received_events","type":"Organization","site_admin":false},"repo":{"id":5086313,"name":"django-wiki","full_name":"django-wiki/django-wiki","owner":{"login":"django-wiki","id":7289936,"avatar_url":"https://avatars.githubusercontent.com/u/7289936?v=3","gravatar_id":"","url":"https://api.github.com/users/django-wiki","html_url":"https://github.com/django-wiki","followers_url":"https://api.github.com/users/django-wiki/followers","following_url":"https://api.github.com/users/django-wiki/following{/other_user}","gists_url":"https://api.github.com/users/django-wiki/gists{/gist_id}","starred_url":"https://api.github.com/users/django-wiki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-wiki/subscriptions","organizations_url":"https://api.github.com/users/django-wiki/orgs","repos_url":"https://api.github.com/users/django-wiki/repos","events_url":"https://api.github.com/users/django-wiki/events{/privacy}","received_events_url":"https://api.github.com/users/django-wiki/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django-wiki/django-wiki","description":"A wiki system with complex functionality for simple integration and a superb interface. Store your knowledge with style: Use django models.","fork":false,"url":"https://api.github.com/repos/django-wiki/django-wiki","forks_url":"https://api.github.com/repos/django-wiki/django-wiki/forks","keys_url":"https://api.github.com/repos/django-wiki/django-wiki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django-wiki/django-wiki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django-wiki/django-wiki/teams","hooks_url":"https://api.github.com/repos/django-wiki/django-wiki/hooks","issue_events_url":"https://api.github.com/repos/django-wiki/django-wiki/issues/events{/number}","events_url":"https://api.github.com/repos/django-wiki/django-wiki/events","assignees_url":"https://api.github.com/repos/django-wiki/django-wiki/assignees{/user}","branches_url":"https://api.github.com/repos/django-wiki/django-wiki/branches{/branch}","tags_url":"https://api.github.com/repos/django-wiki/django-wiki/tags","blobs_url":"https://api.github.com/repos/django-wiki/django-wiki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django-wiki/django-wiki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django-wiki/django-wiki/git/refs{/sha}","trees_url":"https://api.github.com/repos/django-wiki/django-wiki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django-wiki/django-wiki/statuses/{sha}","languages_url":"https://api.github.com/repos/django-wiki/django-wiki/languages","stargazers_url":"https://api.github.com/repos/django-wiki/django-wiki/stargazers","contributors_url":"https://api.github.com/repos/django-wiki/django-wiki/contributors","subscribers_url":"https://api.github.com/repos/django-wiki/django-wiki/subscribers","subscription_url":"https://api.github.com/repos/django-wiki/django-wiki/subscription","commits_url":"https://api.github.com/repos/django-wiki/django-wiki/commits{/sha}","git_commits_url":"https://api.github.com/repos/django-wiki/django-wiki/git/commits{/sha}","comments_url":"https://api.github.com/repos/django-wiki/django-wiki/comments{/number}","issue_comment_url":"https://api.github.com/repos/django-wiki/django-wiki/issues/comments{/number}","contents_url":"https://api.github.com/repos/django-wiki/django-wiki/contents/{+path}","compare_url":"https://api.github.com/repos/django-wiki/django-wiki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django-wiki/django-wiki/merges","archive_url":"https://api.github.com/repos/django-wiki/django-wiki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django-wiki/django-wiki/downloads","issues_url":"https://api.github.com/repos/django-wiki/django-wiki/issues{/number}","pulls_url":"https://api.github.com/repos/django-wiki/django-wiki/pulls{/number}","milestones_url":"https://api.github.com/repos/django-wiki/django-wiki/milestones{/number}","notifications_url":"https://api.github.com/repos/django-wiki/django-wiki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django-wiki/django-wiki/labels{/name}","releases_url":"https://api.github.com/repos/django-wiki/django-wiki/releases{/id}","deployments_url":"https://api.github.com/repos/django-wiki/django-wiki/deployments","created_at":"2012-07-17T18:46:09Z","updated_at":"2016-06-18T21:56:14Z","pushed_at":"2016-06-19T17:57:33Z","git_url":"git://github.com/django-wiki/django-wiki.git","ssh_url":"git@github.com:django-wiki/django-wiki.git","clone_url":"https://github.com/django-wiki/django-wiki.git","svn_url":"https://github.com/django-wiki/django-wiki","homepage":"https://demo.django.wiki","size":7813,"stargazers_count":599,"watchers_count":599,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":280,"mirror_url":null,"open_issues_count":35,"forks":280,"open_issues":35,"watchers":599,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552"},"html":{"href":"https://github.com/django-wiki/django-wiki/pull/552"},"issue":{"href":"https://api.github.com/repos/django-wiki/django-wiki/issues/552"},"comments":{"href":"https://api.github.com/repos/django-wiki/django-wiki/issues/552/comments"},"review_comments":{"href":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552/comments"},"review_comment":{"href":"https://api.github.com/repos/django-wiki/django-wiki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django-wiki/django-wiki/pulls/552/commits"},"statuses":{"href":"https://api.github.com/repos/django-wiki/django-wiki/statuses/63635368531d22468019d7afc60d5edc076f427b"}}}}
{"actor":{"display_login":"duvholt"}}