{"action":"created","comment":{"url":"https://api.github.com/repos/7enderhead/antiweb/pulls/comments/55184114","id":55184114,"diff_hunk":"@@ -1465,18 +1465,156 @@ def filter_output(self, lines):\n                 #remove comment chars in document lines\n                 stext = l.text.lstrip()\n \n-                if stext == '/*' or stext == \"*/\":\n+                if stext == \"/*\" or stext == \"*/\":\n                     #remove /* and */ from documentation lines\n                     #see the l.text.lstrip()! if the lines ends with a white space\n                     #the quotes will be kept! This is feature, to force the quotes\n                     #in the output\n                     continue\n                 \n-                if stext.startswith(\"//\") and not stext.startswith(\"#####\"):\n-                    #remove comments but not chapters\n+                if stext.startswith(\"//\"):\n                     l.text = l.indented(stext[2:])\n                             \n             yield l\n+#edoc\n+\n+#@cstart(CSharpReader)\n+class CSharpReader(CReader):\n+    #@start(CSharpReader doc)\n+    #CSharpReader\n+    #=============\n+    \"\"\"\n+    .. py:class:: CSharpReader\n+\n+       A reader for C# code. This class inherits :py:class:`CReader`.\n+    \"\"\"\n+    \n+    #@indent 3\n+    #@include(CSharpReader)\n+    #@include(CSharpReader.strip_tags doc)\n+    #@include(CSharpReader.get_attribute_text doc)\n+    #@include(CSharpReader.filter_output doc)\n+    #@(CSharpReader doc)\n+    \n+    def _accept_token(self, token):\n+        return super(CSharpReader, self)._accept_token(token)\n+    \n+    def _cut_comment(self, index, token, text):\n+        return super(CSharpReader, self)._cut_comment(index, token, text)\n+        \n+    #@cstart(CSharpReader.strip_tags)\n+    def strip_tags(self,  soup):\n+        \"\"\"\n+        .. py:method:: strip_tags(soup)\n+\n+           Removes all C# XML tags. The tags are replaced by their attributes and contents.\n+\n+           :param soup: The parsed xml tags.\n+           :return: the XML tags replaced by their attributes and contents.\n+        \"\"\"\n+        if isinstance(soup,  Tag) and not soup.contents:            \n+            return self.get_attribute_text(soup)\n+    \n+        for tag in soup.find_all(True):\n+            text = self.get_attribute_text(tag)\n+            \n+            #if the content is a Navigablestring the content is simply concatenated \n+            #otherwise the contents of the content are recursively checked for xml tags\n+            for content in tag.contents:\n+                if not isinstance(content, NavigableString):\n+                    content = self.strip_tags(content)\n+                text += content\n+    \n+            tag.replaceWith(text)\n+    \n+        return soup\n+    #@edoc\n+    \n+    #@cstart(CSharpReader.get_attribute_text)\n+    def get_attribute_text(self,  tag):\n+        \"\"\"\n+        .. py:method:: get_attribute_text(tag)\n+\n+           Gets the values of all attributes of a XML tag.\n+\n+           :param tag: A BeautifulSoup Tag.\n+           :return: the values of all attributes concatenated\n+        \"\"\"\n+        #collect all values of xml tag attributes\n+        attributes = tag.attrs\n+        attribute_text = \"\"\n+        for attribute, value in attributes.items():\n+            attribute_text = value + \" \"\n+        return attribute_text\n+    #@edoc\n+    \n+    #@cstart(CSharpReader.filter_output)\n+    def filter_output(self, lines):\n+        \"\"\"\n+        .. py:method:: filter_output(lines)\n+        \n+           Applies C# specific filtering for the final output.\n+           XML comment tags are replaced by their attributes and contents.\n+\n+           See :py:meth:`Reader.filter_output`\n+           \n+           :param lines: All lines of a file. The directives have already been replaced.\n+           :return: A generator containing all lines for the final output.\n+        \"\"\"\n+        #first the CReader filters the output\n+        #afterwards the CSharpReader does some C# specific filtering\n+        lines = super(CSharpReader, self).filter_output(lines)\n+                \n+        xml_lines_block = []\n+        xml_start_index = -1\n+        \n+        for l in lines:\n+            if l.type == \"d\":\n+                #remove comment chars in document lines\n+                stext = l.text.lstrip()\n+\n+                if stext == \"/*\" or stext == \"*/\":\n+                    #remove /* and */ from documentation lines\n+                    #see the l.text.lstrip()! if the lines ends with a white space\n+                    #the quotes will be kept! This is feature, to force the quotes\n+                    #in the output\n+                    continue\n+\n+                if stext.startswith(\"/\") and not stext.startswith(\"/*\"):\n+                    #this is needed if a comment line was defined with ///\n+                    l.text = l.indented(stext[1:])\n+                    \n+                    #if a new xml tag block starts, save the current line index and\n+                    #add the line to the xml_lines_block\n+                    if(xml_start_index == -1):\n+                        xml_start_index = l.index\n+                        \n+                    xml_lines_block.append(l)\n+                    continue \n+                elif not xml_start_index == -1:\n+                    #all xml lines have been collected for this block and can be processed\n+                    xml_text = \"\\n\".join(map(operator.attrgetter(\"text\"), xml_lines_block))\n+                    \n+                    #the xml lines will be parsed and then all xml tags will be removed       \n+                    soup = BeautifulSoup(xml_text, \"html.parser\")\n+                    self.strip_tags(soup)\n+                    stripped_xml_lines = soup.text.splitlines()\n+                    \n+                    #the indent if the first xml line will be used for all lines in that block\n+                    #for each stripped xml line a Line object is created and added the final line generator\n+                    initialLine = xml_lines_block[0]                    \n+                    index = xml_start_index\n+                    for line in stripped_xml_lines:\n+                        new_line = Line(initialLine.fname,  index,  initialLine.indented(line.lstrip()))\n+                        index += 1\n+                        yield new_line\n+                    \n+                    #reset the xml variables for the next block\n+                    xml_start_index = -1\n+                    xml_lines_block = []\n+\n+            yield l","path":"antiweb.py","position":243,"original_position":243,"commit_id":"a883f0203a84321357e895b9324ba46847caf136","original_commit_id":"a883f0203a84321357e895b9324ba46847caf136","user":{"login":"7enderhead","id":339726,"avatar_url":"https://avatars.githubusercontent.com/u/339726?v=3","gravatar_id":"","url":"https://api.github.com/users/7enderhead","html_url":"https://github.com/7enderhead","followers_url":"https://api.github.com/users/7enderhead/followers","following_url":"https://api.github.com/users/7enderhead/following{/other_user}","gists_url":"https://api.github.com/users/7enderhead/gists{/gist_id}","starred_url":"https://api.github.com/users/7enderhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/7enderhead/subscriptions","organizations_url":"https://api.github.com/users/7enderhead/orgs","repos_url":"https://api.github.com/users/7enderhead/repos","events_url":"https://api.github.com/users/7enderhead/events{/privacy}","received_events_url":"https://api.github.com/users/7enderhead/received_events","type":"User","site_admin":false},"body":"Please document value (why 1?)","created_at":"2016-03-07T10:19:11Z","updated_at":"2016-03-07T10:19:11Z","html_url":"https://github.com/7enderhead/antiweb/pull/23#discussion_r55184114","pull_request_url":"https://api.github.com/repos/7enderhead/antiweb/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/7enderhead/antiweb/pulls/comments/55184114"},"html":{"href":"https://github.com/7enderhead/antiweb/pull/23#discussion_r55184114"},"pull_request":{"href":"https://api.github.com/repos/7enderhead/antiweb/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/7enderhead/antiweb/pulls/23","id":61457515,"html_url":"https://github.com/7enderhead/antiweb/pull/23","diff_url":"https://github.com/7enderhead/antiweb/pull/23.diff","patch_url":"https://github.com/7enderhead/antiweb/pull/23.patch","issue_url":"https://api.github.com/repos/7enderhead/antiweb/issues/23","number":23,"state":"open","locked":false,"title":"Refs #9 Reuse Microsoft C# XML Annotations","user":{"login":"TannerLukas","id":12410726,"avatar_url":"https://avatars.githubusercontent.com/u/12410726?v=3","gravatar_id":"","url":"https://api.github.com/users/TannerLukas","html_url":"https://github.com/TannerLukas","followers_url":"https://api.github.com/users/TannerLukas/followers","following_url":"https://api.github.com/users/TannerLukas/following{/other_user}","gists_url":"https://api.github.com/users/TannerLukas/gists{/gist_id}","starred_url":"https://api.github.com/users/TannerLukas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TannerLukas/subscriptions","organizations_url":"https://api.github.com/users/TannerLukas/orgs","repos_url":"https://api.github.com/users/TannerLukas/repos","events_url":"https://api.github.com/users/TannerLukas/events{/privacy}","received_events_url":"https://api.github.com/users/TannerLukas/received_events","type":"User","site_admin":false},"body":"Added a CSharpReader which does C# specific filtering for the final output.\r\nXML comment tags are replaced by their attribute values and contents.","created_at":"2016-03-02T19:58:05Z","updated_at":"2016-03-07T10:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f483eb9ffd1f3176132735447d4e91f3b613d4f2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/7enderhead/antiweb/pulls/23/commits","review_comments_url":"https://api.github.com/repos/7enderhead/antiweb/pulls/23/comments","review_comment_url":"https://api.github.com/repos/7enderhead/antiweb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/7enderhead/antiweb/issues/23/comments","statuses_url":"https://api.github.com/repos/7enderhead/antiweb/statuses/a883f0203a84321357e895b9324ba46847caf136","head":{"label":"TannerLukas:work","ref":"work","sha":"a883f0203a84321357e895b9324ba46847caf136","user":{"login":"TannerLukas","id":12410726,"avatar_url":"https://avatars.githubusercontent.com/u/12410726?v=3","gravatar_id":"","url":"https://api.github.com/users/TannerLukas","html_url":"https://github.com/TannerLukas","followers_url":"https://api.github.com/users/TannerLukas/followers","following_url":"https://api.github.com/users/TannerLukas/following{/other_user}","gists_url":"https://api.github.com/users/TannerLukas/gists{/gist_id}","starred_url":"https://api.github.com/users/TannerLukas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TannerLukas/subscriptions","organizations_url":"https://api.github.com/users/TannerLukas/orgs","repos_url":"https://api.github.com/users/TannerLukas/repos","events_url":"https://api.github.com/users/TannerLukas/events{/privacy}","received_events_url":"https://api.github.com/users/TannerLukas/received_events","type":"User","site_admin":false},"repo":{"id":52989730,"name":"antiweb","full_name":"TannerLukas/antiweb","owner":{"login":"TannerLukas","id":12410726,"avatar_url":"https://avatars.githubusercontent.com/u/12410726?v=3","gravatar_id":"","url":"https://api.github.com/users/TannerLukas","html_url":"https://github.com/TannerLukas","followers_url":"https://api.github.com/users/TannerLukas/followers","following_url":"https://api.github.com/users/TannerLukas/following{/other_user}","gists_url":"https://api.github.com/users/TannerLukas/gists{/gist_id}","starred_url":"https://api.github.com/users/TannerLukas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TannerLukas/subscriptions","organizations_url":"https://api.github.com/users/TannerLukas/orgs","repos_url":"https://api.github.com/users/TannerLukas/repos","events_url":"https://api.github.com/users/TannerLukas/events{/privacy}","received_events_url":"https://api.github.com/users/TannerLukas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TannerLukas/antiweb","description":"Modifications and Extensions to the antiweb Literate Programming Tool","fork":true,"url":"https://api.github.com/repos/TannerLukas/antiweb","forks_url":"https://api.github.com/repos/TannerLukas/antiweb/forks","keys_url":"https://api.github.com/repos/TannerLukas/antiweb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TannerLukas/antiweb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TannerLukas/antiweb/teams","hooks_url":"https://api.github.com/repos/TannerLukas/antiweb/hooks","issue_events_url":"https://api.github.com/repos/TannerLukas/antiweb/issues/events{/number}","events_url":"https://api.github.com/repos/TannerLukas/antiweb/events","assignees_url":"https://api.github.com/repos/TannerLukas/antiweb/assignees{/user}","branches_url":"https://api.github.com/repos/TannerLukas/antiweb/branches{/branch}","tags_url":"https://api.github.com/repos/TannerLukas/antiweb/tags","blobs_url":"https://api.github.com/repos/TannerLukas/antiweb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TannerLukas/antiweb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TannerLukas/antiweb/git/refs{/sha}","trees_url":"https://api.github.com/repos/TannerLukas/antiweb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TannerLukas/antiweb/statuses/{sha}","languages_url":"https://api.github.com/repos/TannerLukas/antiweb/languages","stargazers_url":"https://api.github.com/repos/TannerLukas/antiweb/stargazers","contributors_url":"https://api.github.com/repos/TannerLukas/antiweb/contributors","subscribers_url":"https://api.github.com/repos/TannerLukas/antiweb/subscribers","subscription_url":"https://api.github.com/repos/TannerLukas/antiweb/subscription","commits_url":"https://api.github.com/repos/TannerLukas/antiweb/commits{/sha}","git_commits_url":"https://api.github.com/repos/TannerLukas/antiweb/git/commits{/sha}","comments_url":"https://api.github.com/repos/TannerLukas/antiweb/comments{/number}","issue_comment_url":"https://api.github.com/repos/TannerLukas/antiweb/issues/comments{/number}","contents_url":"https://api.github.com/repos/TannerLukas/antiweb/contents/{+path}","compare_url":"https://api.github.com/repos/TannerLukas/antiweb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TannerLukas/antiweb/merges","archive_url":"https://api.github.com/repos/TannerLukas/antiweb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TannerLukas/antiweb/downloads","issues_url":"https://api.github.com/repos/TannerLukas/antiweb/issues{/number}","pulls_url":"https://api.github.com/repos/TannerLukas/antiweb/pulls{/number}","milestones_url":"https://api.github.com/repos/TannerLukas/antiweb/milestones{/number}","notifications_url":"https://api.github.com/repos/TannerLukas/antiweb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TannerLukas/antiweb/labels{/name}","releases_url":"https://api.github.com/repos/TannerLukas/antiweb/releases{/id}","deployments_url":"https://api.github.com/repos/TannerLukas/antiweb/deployments","created_at":"2016-03-02T19:23:45Z","updated_at":"2016-03-02T19:23:47Z","pushed_at":"2016-03-02T19:53:37Z","git_url":"git://github.com/TannerLukas/antiweb.git","ssh_url":"git@github.com:TannerLukas/antiweb.git","clone_url":"https://github.com/TannerLukas/antiweb.git","svn_url":"https://github.com/TannerLukas/antiweb","homepage":null,"size":4373,"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":"7enderhead:work","ref":"work","sha":"2e775ef99e57f2478aa9abd9317136663c3c9fed","user":{"login":"7enderhead","id":339726,"avatar_url":"https://avatars.githubusercontent.com/u/339726?v=3","gravatar_id":"","url":"https://api.github.com/users/7enderhead","html_url":"https://github.com/7enderhead","followers_url":"https://api.github.com/users/7enderhead/followers","following_url":"https://api.github.com/users/7enderhead/following{/other_user}","gists_url":"https://api.github.com/users/7enderhead/gists{/gist_id}","starred_url":"https://api.github.com/users/7enderhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/7enderhead/subscriptions","organizations_url":"https://api.github.com/users/7enderhead/orgs","repos_url":"https://api.github.com/users/7enderhead/repos","events_url":"https://api.github.com/users/7enderhead/events{/privacy}","received_events_url":"https://api.github.com/users/7enderhead/received_events","type":"User","site_admin":false},"repo":{"id":35487371,"name":"antiweb","full_name":"7enderhead/antiweb","owner":{"login":"7enderhead","id":339726,"avatar_url":"https://avatars.githubusercontent.com/u/339726?v=3","gravatar_id":"","url":"https://api.github.com/users/7enderhead","html_url":"https://github.com/7enderhead","followers_url":"https://api.github.com/users/7enderhead/followers","following_url":"https://api.github.com/users/7enderhead/following{/other_user}","gists_url":"https://api.github.com/users/7enderhead/gists{/gist_id}","starred_url":"https://api.github.com/users/7enderhead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/7enderhead/subscriptions","organizations_url":"https://api.github.com/users/7enderhead/orgs","repos_url":"https://api.github.com/users/7enderhead/repos","events_url":"https://api.github.com/users/7enderhead/events{/privacy}","received_events_url":"https://api.github.com/users/7enderhead/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/7enderhead/antiweb","description":"Modifications and Extensions to the antiweb Literate Programming Tool","fork":false,"url":"https://api.github.com/repos/7enderhead/antiweb","forks_url":"https://api.github.com/repos/7enderhead/antiweb/forks","keys_url":"https://api.github.com/repos/7enderhead/antiweb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/7enderhead/antiweb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/7enderhead/antiweb/teams","hooks_url":"https://api.github.com/repos/7enderhead/antiweb/hooks","issue_events_url":"https://api.github.com/repos/7enderhead/antiweb/issues/events{/number}","events_url":"https://api.github.com/repos/7enderhead/antiweb/events","assignees_url":"https://api.github.com/repos/7enderhead/antiweb/assignees{/user}","branches_url":"https://api.github.com/repos/7enderhead/antiweb/branches{/branch}","tags_url":"https://api.github.com/repos/7enderhead/antiweb/tags","blobs_url":"https://api.github.com/repos/7enderhead/antiweb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/7enderhead/antiweb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/7enderhead/antiweb/git/refs{/sha}","trees_url":"https://api.github.com/repos/7enderhead/antiweb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/7enderhead/antiweb/statuses/{sha}","languages_url":"https://api.github.com/repos/7enderhead/antiweb/languages","stargazers_url":"https://api.github.com/repos/7enderhead/antiweb/stargazers","contributors_url":"https://api.github.com/repos/7enderhead/antiweb/contributors","subscribers_url":"https://api.github.com/repos/7enderhead/antiweb/subscribers","subscription_url":"https://api.github.com/repos/7enderhead/antiweb/subscription","commits_url":"https://api.github.com/repos/7enderhead/antiweb/commits{/sha}","git_commits_url":"https://api.github.com/repos/7enderhead/antiweb/git/commits{/sha}","comments_url":"https://api.github.com/repos/7enderhead/antiweb/comments{/number}","issue_comment_url":"https://api.github.com/repos/7enderhead/antiweb/issues/comments{/number}","contents_url":"https://api.github.com/repos/7enderhead/antiweb/contents/{+path}","compare_url":"https://api.github.com/repos/7enderhead/antiweb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/7enderhead/antiweb/merges","archive_url":"https://api.github.com/repos/7enderhead/antiweb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/7enderhead/antiweb/downloads","issues_url":"https://api.github.com/repos/7enderhead/antiweb/issues{/number}","pulls_url":"https://api.github.com/repos/7enderhead/antiweb/pulls{/number}","milestones_url":"https://api.github.com/repos/7enderhead/antiweb/milestones{/number}","notifications_url":"https://api.github.com/repos/7enderhead/antiweb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/7enderhead/antiweb/labels{/name}","releases_url":"https://api.github.com/repos/7enderhead/antiweb/releases{/id}","deployments_url":"https://api.github.com/repos/7enderhead/antiweb/deployments","created_at":"2015-05-12T12:47:12Z","updated_at":"2016-02-01T09:40:24Z","pushed_at":"2016-03-02T19:58:06Z","git_url":"git://github.com/7enderhead/antiweb.git","ssh_url":"git@github.com:7enderhead/antiweb.git","clone_url":"https://github.com/7enderhead/antiweb.git","svn_url":"https://github.com/7enderhead/antiweb","homepage":null,"size":3739,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":9,"forks":3,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/7enderhead/antiweb/pulls/23"},"html":{"href":"https://github.com/7enderhead/antiweb/pull/23"},"issue":{"href":"https://api.github.com/repos/7enderhead/antiweb/issues/23"},"comments":{"href":"https://api.github.com/repos/7enderhead/antiweb/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/7enderhead/antiweb/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/7enderhead/antiweb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/7enderhead/antiweb/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/7enderhead/antiweb/statuses/a883f0203a84321357e895b9324ba46847caf136"}}}}