prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Markdown unordered lists do not work in update notes
  Filling the update notes under https://bodhi.fedoraproject.org/updates/new with unordered lists in markdown syntax (https://help.github.com/articles/markdown-basics/) does not work, neither in the preview nor after submitting, visit e.g. https://bodhi.fedoraproject.org/updates/phpMyAdmin-4.4.14-1.fc23 with Firefox 38 ESR from RHEL/CentOS 6. It seems to work properly with a text browser such as w3m (CSS issue?).
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `bodhi/ffmarkdown.py`
  Content:
  ```
  1 # This program is free software; you can redistribute it and/or
  2 # modify it under the terms of the GNU General Public License
  3 # as published by the Free Software Foundation; either version 2
  4 # of the License, or (at your option) any later version.
  5 #
  6 # This program is distributed in the hope that it will be useful,
  7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
  8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9 # GNU General Public License for more details.
  10 #
  11 # You should have received a copy of the GNU General Public License
  12 # along with this program; if not, write to the Free Software
  13 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
  14 # USA.
  15 
  16 """ Fedora-flavored Markdown
  17 
  18 Author: Ralph Bean <rbean@redhat.com>
  19 """
  20 
  21 import markdown.inlinepatterns
  22 import markdown.util
  23 import pyramid.threadlocal
  24 
  25 
  26 def user_url(name):
  27     request = pyramid.threadlocal.get_current_request()
  28     return request.route_url('user', name=name)
  29 
  30 
  31 def bugzilla_url(idx):
  32     return "https://bugzilla.redhat.com/show_bug.cgi?id=%s" % idx
  33 
  34 
  35 def inject():
  36     """ Hack out python-markdown to do the autolinking that we want. """
  37 
  38     # First, make it so that bare links get automatically linkified.
  39     markdown.inlinepatterns.AUTOLINK_RE = '(%s)' % '|'.join([
  40         r'<(?:f|ht)tps?://[^>]*>',
  41         r'\b(?:f|ht)tps?://[^)<>\s]+[^.,)<>\s]',
  42         r'\bwww\.[^)<>\s]+[^.,)<>\s]',
  43         r'[^(<\s]+\.(?:com|net|org)\b',
  44     ])
  45 
  46     # Second, build some Pattern objects for @mentions, #bugs, etc...
  47     class MentionPattern(markdown.inlinepatterns.Pattern):
  48         def handleMatch(self, m):
  49             el = markdown.util.etree.Element("a")
  50             name = markdown.util.AtomicString(m.group(2))
  51             el.set('href', user_url(name[1:]))
  52             el.text = name
  53             return el
  54 
  55     class BugzillaPattern(markdown.inlinepatterns.Pattern):
  56         def handleMatch(self, m):
  57             el = markdown.util.etree.Element("a")
  58             idx = markdown.util.AtomicString(m.group(2))
  59             el.set('href', bugzilla_url(idx[1:]))
  60             el.text = idx
  61             return el
  62 
  63     MENTION_RE = r'(@\w+)'
  64     BUGZILLA_RE = r'(#[0-9]{5,})'
  65 
  66     # Lastly, monkey-patch the build_inlinepatterns func to insert our patterns
  67     original_builder = markdown.build_inlinepatterns
  68 
  69     def extended_builder(md_instance, **kwargs):
  70         patterns = original_builder(md_instance, **kwargs)
  71         patterns['mention'] = MentionPattern(MENTION_RE, md_instance)
  72         patterns['bugzillas'] = BugzillaPattern(BUGZILLA_RE, md_instance)
  73         return patterns
  74 
  75     markdown.build_inlinepatterns = extended_builder
  76
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/bodhi/ffmarkdown.py b/bodhi/ffmarkdown.py
  --- a/bodhi/ffmarkdown.py
  +++ b/bodhi/ffmarkdown.py
  @@ -19,6 +19,7 @@
   """
   
   import markdown.inlinepatterns
  +import markdown.postprocessors
   import markdown.util
   import pyramid.threadlocal
   
  @@ -63,13 +64,26 @@
       MENTION_RE = r'(@\w+)'
       BUGZILLA_RE = r'(#[0-9]{5,})'
   
  +    class SurroundProcessor(markdown.postprocessors.Postprocessor):
  +        def run(self, text):
  +            return "<div class='markdown'>" + text + "</div>"
  +
       # Lastly, monkey-patch the build_inlinepatterns func to insert our patterns
  -    original_builder = markdown.build_inlinepatterns
  +    original_pattern_builder = markdown.build_inlinepatterns
   
  -    def extended_builder(md_instance, **kwargs):
  -        patterns = original_builder(md_instance, **kwargs)
  +    def extended_pattern_builder(md_instance, **kwargs):
  +        patterns = original_pattern_builder(md_instance, **kwargs)
           patterns['mention'] = MentionPattern(MENTION_RE, md_instance)
           patterns['bugzillas'] = BugzillaPattern(BUGZILLA_RE, md_instance)
           return patterns
   
  -    markdown.build_inlinepatterns = extended_builder
  +    markdown.build_inlinepatterns = extended_pattern_builder
  +
  +    original_postprocessor_builder = markdown.build_postprocessors
  +
  +    def extended_postprocessor_builder(md_instance, **kwargs):
  +        processors = original_postprocessor_builder(md_instance, **kwargs)
  +        processors['surround'] = SurroundProcessor(md_instance)
  +        return processors
  +
  +    markdown.build_postprocessors = extended_postprocessor_builder
  
verification_info: {"golden_diff": "diff --git a/bodhi/ffmarkdown.py b/bodhi/ffmarkdown.py\n--- a/bodhi/ffmarkdown.py\n+++ b/bodhi/ffmarkdown.py\n@@ -19,6 +19,7 @@\n \"\"\"\n \n import markdown.inlinepatterns\n+import markdown.postprocessors\n import markdown.util\n import pyramid.threadlocal\n \n@@ -63,13 +64,26 @@\n     MENTION_RE = r'(@\\w+)'\n     BUGZILLA_RE = r'(#[0-9]{5,})'\n \n+    class SurroundProcessor(markdown.postprocessors.Postprocessor):\n+        def run(self, text):\n+            return \"<div class='markdown'>\" + text + \"</div>\"\n+\n     # Lastly, monkey-patch the build_inlinepatterns func to insert our patterns\n-    original_builder = markdown.build_inlinepatterns\n+    original_pattern_builder = markdown.build_inlinepatterns\n \n-    def extended_builder(md_instance, **kwargs):\n-        patterns = original_builder(md_instance, **kwargs)\n+    def extended_pattern_builder(md_instance, **kwargs):\n+        patterns = original_pattern_builder(md_instance, **kwargs)\n         patterns['mention'] = MentionPattern(MENTION_RE, md_instance)\n         patterns['bugzillas'] = BugzillaPattern(BUGZILLA_RE, md_instance)\n         return patterns\n \n-    markdown.build_inlinepatterns = extended_builder\n+    markdown.build_inlinepatterns = extended_pattern_builder\n+\n+    original_postprocessor_builder = markdown.build_postprocessors\n+\n+    def extended_postprocessor_builder(md_instance, **kwargs):\n+        processors = original_postprocessor_builder(md_instance, **kwargs)\n+        processors['surround'] = SurroundProcessor(md_instance)\n+        return processors\n+\n+    markdown.build_postprocessors = extended_postprocessor_builder\n", "issue": "Markdown unordered lists do not work in update notes\nFilling the update notes under https://bodhi.fedoraproject.org/updates/new with unordered lists in markdown syntax (https://help.github.com/articles/markdown-basics/) does not work, neither in the preview nor after submitting, visit e.g. https://bodhi.fedoraproject.org/updates/phpMyAdmin-4.4.14-1.fc23 with Firefox 38 ESR from RHEL/CentOS 6. It seems to work properly with a text browser such as w3m (CSS issue?).\n\n", "before_files": [{"content": "# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,\n# USA.\n\n\"\"\" Fedora-flavored Markdown\n\nAuthor: Ralph Bean <rbean@redhat.com>\n\"\"\"\n\nimport markdown.inlinepatterns\nimport markdown.util\nimport pyramid.threadlocal\n\n\ndef user_url(name):\n    request = pyramid.threadlocal.get_current_request()\n    return request.route_url('user', name=name)\n\n\ndef bugzilla_url(idx):\n    return \"https://bugzilla.redhat.com/show_bug.cgi?id=%s\" % idx\n\n\ndef inject():\n    \"\"\" Hack out python-markdown to do the autolinking that we want. \"\"\"\n\n    # First, make it so that bare links get automatically linkified.\n    markdown.inlinepatterns.AUTOLINK_RE = '(%s)' % '|'.join([\n        r'<(?:f|ht)tps?://[^>]*>',\n        r'\\b(?:f|ht)tps?://[^)<>\\s]+[^.,)<>\\s]',\n        r'\\bwww\\.[^)<>\\s]+[^.,)<>\\s]',\n        r'[^(<\\s]+\\.(?:com|net|org)\\b',\n    ])\n\n    # Second, build some Pattern objects for @mentions, #bugs, etc...\n    class MentionPattern(markdown.inlinepatterns.Pattern):\n        def handleMatch(self, m):\n            el = markdown.util.etree.Element(\"a\")\n            name = markdown.util.AtomicString(m.group(2))\n            el.set('href', user_url(name[1:]))\n            el.text = name\n            return el\n\n    class BugzillaPattern(markdown.inlinepatterns.Pattern):\n        def handleMatch(self, m):\n            el = markdown.util.etree.Element(\"a\")\n            idx = markdown.util.AtomicString(m.group(2))\n            el.set('href', bugzilla_url(idx[1:]))\n            el.text = idx\n            return el\n\n    MENTION_RE = r'(@\\w+)'\n    BUGZILLA_RE = r'(#[0-9]{5,})'\n\n    # Lastly, monkey-patch the build_inlinepatterns func to insert our patterns\n    original_builder = markdown.build_inlinepatterns\n\n    def extended_builder(md_instance, **kwargs):\n        patterns = original_builder(md_instance, **kwargs)\n        patterns['mention'] = MentionPattern(MENTION_RE, md_instance)\n        patterns['bugzillas'] = BugzillaPattern(BUGZILLA_RE, md_instance)\n        return patterns\n\n    markdown.build_inlinepatterns = extended_builder\n", "path": "bodhi/ffmarkdown.py"}], "after_files": [{"content": "# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,\n# USA.\n\n\"\"\" Fedora-flavored Markdown\n\nAuthor: Ralph Bean <rbean@redhat.com>\n\"\"\"\n\nimport markdown.inlinepatterns\nimport markdown.postprocessors\nimport markdown.util\nimport pyramid.threadlocal\n\n\ndef user_url(name):\n    request = pyramid.threadlocal.get_current_request()\n    return request.route_url('user', name=name)\n\n\ndef bugzilla_url(idx):\n    return \"https://bugzilla.redhat.com/show_bug.cgi?id=%s\" % idx\n\n\ndef inject():\n    \"\"\" Hack out python-markdown to do the autolinking that we want. \"\"\"\n\n    # First, make it so that bare links get automatically linkified.\n    markdown.inlinepatterns.AUTOLINK_RE = '(%s)' % '|'.join([\n        r'<(?:f|ht)tps?://[^>]*>',\n        r'\\b(?:f|ht)tps?://[^)<>\\s]+[^.,)<>\\s]',\n        r'\\bwww\\.[^)<>\\s]+[^.,)<>\\s]',\n        r'[^(<\\s]+\\.(?:com|net|org)\\b',\n    ])\n\n    # Second, build some Pattern objects for @mentions, #bugs, etc...\n    class MentionPattern(markdown.inlinepatterns.Pattern):\n        def handleMatch(self, m):\n            el = markdown.util.etree.Element(\"a\")\n            name = markdown.util.AtomicString(m.group(2))\n            el.set('href', user_url(name[1:]))\n            el.text = name\n            return el\n\n    class BugzillaPattern(markdown.inlinepatterns.Pattern):\n        def handleMatch(self, m):\n            el = markdown.util.etree.Element(\"a\")\n            idx = markdown.util.AtomicString(m.group(2))\n            el.set('href', bugzilla_url(idx[1:]))\n            el.text = idx\n            return el\n\n    MENTION_RE = r'(@\\w+)'\n    BUGZILLA_RE = r'(#[0-9]{5,})'\n\n    class SurroundProcessor(markdown.postprocessors.Postprocessor):\n        def run(self, text):\n            return \"<div class='markdown'>\" + text + \"</div>\"\n\n    # Lastly, monkey-patch the build_inlinepatterns func to insert our patterns\n    original_pattern_builder = markdown.build_inlinepatterns\n\n    def extended_pattern_builder(md_instance, **kwargs):\n        patterns = original_pattern_builder(md_instance, **kwargs)\n        patterns['mention'] = MentionPattern(MENTION_RE, md_instance)\n        patterns['bugzillas'] = BugzillaPattern(BUGZILLA_RE, md_instance)\n        return patterns\n\n    markdown.build_inlinepatterns = extended_pattern_builder\n\n    original_postprocessor_builder = markdown.build_postprocessors\n\n    def extended_postprocessor_builder(md_instance, **kwargs):\n        processors = original_postprocessor_builder(md_instance, **kwargs)\n        processors['surround'] = SurroundProcessor(md_instance)\n        return processors\n\n    markdown.build_postprocessors = extended_postprocessor_builder\n", "path": "bodhi/ffmarkdown.py"}]}