We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
abbr support doesn't work for multiline
Eg:

``` rst
this is an :abbr:`TLA (Three Letter
Abbreviation)`
```

will output
`<abbr>TLA (Three Letter Abbreviation)</abbr>`

instead of
`<abbr title="Three Letter Abbreviation">TLA</abbr>`

I believe this could be fixed by adding the `re.M` flag to the `re.compile` call on this line: https://github.com/getpelican/pelican/blob/636fd6cc380f2537924532a587c70e96a386e25c/pelican/rstdirectives.py#L101

This refs ticket #395 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pelican/rstdirectives.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals, print_function
3 
4 from docutils import nodes, utils
5 from docutils.parsers.rst import directives, roles, Directive
6 from pygments.formatters import HtmlFormatter
7 from pygments import highlight
8 from pygments.lexers import get_lexer_by_name, TextLexer
9 import re
10 import six
11 import pelican.settings as pys
12 
13 
14 class Pygments(Directive):
15     """ Source code syntax highlighting.
16     """
17     required_arguments = 1
18     optional_arguments = 0
19     final_argument_whitespace = True
20     option_spec = {
21         'anchorlinenos': directives.flag,
22         'classprefix': directives.unchanged,
23         'hl_lines': directives.unchanged,
24         'lineanchors': directives.unchanged,
25         'linenos': directives.unchanged,
26         'linenospecial': directives.nonnegative_int,
27         'linenostart': directives.nonnegative_int,
28         'linenostep': directives.nonnegative_int,
29         'lineseparator': directives.unchanged,
30         'linespans': directives.unchanged,
31         'nobackground': directives.flag,
32         'nowrap': directives.flag,
33         'tagsfile': directives.unchanged,
34         'tagurlformat': directives.unchanged,
35     }
36     has_content = True
37 
38     def run(self):
39         self.assert_has_content()
40         try:
41             lexer = get_lexer_by_name(self.arguments[0])
42         except ValueError:
43             # no lexer found - use the text one instead of an exception
44             lexer = TextLexer()
45 
46         # Fetch the defaults
47         if pys.PYGMENTS_RST_OPTIONS is not None:
48             for k, v in six.iteritems(pys.PYGMENTS_RST_OPTIONS):
49                 # Locally set options overrides the defaults
50                 if k not in self.options:
51                     self.options[k] = v
52 
53         if ('linenos' in self.options and
54                 self.options['linenos'] not in ('table', 'inline')):
55             if self.options['linenos'] == 'none':
56                 self.options.pop('linenos')
57             else:
58                 self.options['linenos'] = 'table'
59 
60         for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
61             if flag in self.options:
62                 self.options[flag] = True
63 
64         # noclasses should already default to False, but just in case...
65         formatter = HtmlFormatter(noclasses=False, **self.options)
66         parsed = highlight('\n'.join(self.content), lexer, formatter)
67         return [nodes.raw('', parsed, format='html')]
68 
69 directives.register_directive('code-block', Pygments)
70 directives.register_directive('sourcecode', Pygments)
71 
72 
73 _abbr_re = re.compile('\((.*)\)$')
74 
75 
76 class abbreviation(nodes.Inline, nodes.TextElement):
77     pass
78 
79 
80 def abbr_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
81     text = utils.unescape(text)
82     m = _abbr_re.search(text)
83     if m is None:
84         return [abbreviation(text, text)], []
85     abbr = text[:m.start()].strip()
86     expl = m.group(1)
87     return [abbreviation(abbr, abbr, explanation=expl)], []
88 
89 roles.register_local_role('abbr', abbr_role)
90
```
--- 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()

```

diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py
--- a/pelican/rstdirectives.py
+++ b/pelican/rstdirectives.py
@@ -70,7 +70,7 @@
 directives.register_directive('sourcecode', Pygments)
 
 
-_abbr_re = re.compile('\((.*)\)$')
+_abbr_re = re.compile('\((.*)\)$', re.DOTALL)
 
 
 class abbreviation(nodes.Inline, nodes.TextElement):

{"golden_diff": "diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py\n--- a/pelican/rstdirectives.py\n+++ b/pelican/rstdirectives.py\n@@ -70,7 +70,7 @@\n directives.register_directive('sourcecode', Pygments)\n \n \n-_abbr_re = re.compile('\\((.*)\\)$')\n+_abbr_re = re.compile('\\((.*)\\)$', re.DOTALL)\n \n \n class abbreviation(nodes.Inline, nodes.TextElement):\n", "issue": "abbr support doesn't work for multiline\nEg:\n\n``` rst\nthis is an :abbr:`TLA (Three Letter\nAbbreviation)`\n```\n\nwill output\n`<abbr>TLA (Three Letter Abbreviation)</abbr>`\n\ninstead of\n`<abbr title=\"Three Letter Abbreviation\">TLA</abbr>`\n\nI believe this could be fixed by adding the `re.M` flag to the `re.compile` call on this line: https://github.com/getpelican/pelican/blob/636fd6cc380f2537924532a587c70e96a386e25c/pelican/rstdirectives.py#L101\n\nThis refs ticket #395 \n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals, print_function\n\nfrom docutils import nodes, utils\nfrom docutils.parsers.rst import directives, roles, Directive\nfrom pygments.formatters import HtmlFormatter\nfrom pygments import highlight\nfrom pygments.lexers import get_lexer_by_name, TextLexer\nimport re\nimport six\nimport pelican.settings as pys\n\n\nclass Pygments(Directive):\n    \"\"\" Source code syntax highlighting.\n    \"\"\"\n    required_arguments = 1\n    optional_arguments = 0\n    final_argument_whitespace = True\n    option_spec = {\n        'anchorlinenos': directives.flag,\n        'classprefix': directives.unchanged,\n        'hl_lines': directives.unchanged,\n        'lineanchors': directives.unchanged,\n        'linenos': directives.unchanged,\n        'linenospecial': directives.nonnegative_int,\n        'linenostart': directives.nonnegative_int,\n        'linenostep': directives.nonnegative_int,\n        'lineseparator': directives.unchanged,\n        'linespans': directives.unchanged,\n        'nobackground': directives.flag,\n        'nowrap': directives.flag,\n        'tagsfile': directives.unchanged,\n        'tagurlformat': directives.unchanged,\n    }\n    has_content = True\n\n    def run(self):\n        self.assert_has_content()\n        try:\n            lexer = get_lexer_by_name(self.arguments[0])\n        except ValueError:\n            # no lexer found - use the text one instead of an exception\n            lexer = TextLexer()\n\n        # Fetch the defaults\n        if pys.PYGMENTS_RST_OPTIONS is not None:\n            for k, v in six.iteritems(pys.PYGMENTS_RST_OPTIONS):\n                # Locally set options overrides the defaults\n                if k not in self.options:\n                    self.options[k] = v\n\n        if ('linenos' in self.options and\n                self.options['linenos'] not in ('table', 'inline')):\n            if self.options['linenos'] == 'none':\n                self.options.pop('linenos')\n            else:\n                self.options['linenos'] = 'table'\n\n        for flag in ('nowrap', 'nobackground', 'anchorlinenos'):\n            if flag in self.options:\n                self.options[flag] = True\n\n        # noclasses should already default to False, but just in case...\n        formatter = HtmlFormatter(noclasses=False, **self.options)\n        parsed = highlight('\\n'.join(self.content), lexer, formatter)\n        return [nodes.raw('', parsed, format='html')]\n\ndirectives.register_directive('code-block', Pygments)\ndirectives.register_directive('sourcecode', Pygments)\n\n\n_abbr_re = re.compile('\\((.*)\\)$')\n\n\nclass abbreviation(nodes.Inline, nodes.TextElement):\n    pass\n\n\ndef abbr_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):\n    text = utils.unescape(text)\n    m = _abbr_re.search(text)\n    if m is None:\n        return [abbreviation(text, text)], []\n    abbr = text[:m.start()].strip()\n    expl = m.group(1)\n    return [abbreviation(abbr, abbr, explanation=expl)], []\n\nroles.register_local_role('abbr', abbr_role)\n", "path": "pelican/rstdirectives.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\nfrom __future__ import unicode_literals, print_function\n\nfrom docutils import nodes, utils\nfrom docutils.parsers.rst import directives, roles, Directive\nfrom pygments.formatters import HtmlFormatter\nfrom pygments import highlight\nfrom pygments.lexers import get_lexer_by_name, TextLexer\nimport re\nimport six\nimport pelican.settings as pys\n\n\nclass Pygments(Directive):\n    \"\"\" Source code syntax highlighting.\n    \"\"\"\n    required_arguments = 1\n    optional_arguments = 0\n    final_argument_whitespace = True\n    option_spec = {\n        'anchorlinenos': directives.flag,\n        'classprefix': directives.unchanged,\n        'hl_lines': directives.unchanged,\n        'lineanchors': directives.unchanged,\n        'linenos': directives.unchanged,\n        'linenospecial': directives.nonnegative_int,\n        'linenostart': directives.nonnegative_int,\n        'linenostep': directives.nonnegative_int,\n        'lineseparator': directives.unchanged,\n        'linespans': directives.unchanged,\n        'nobackground': directives.flag,\n        'nowrap': directives.flag,\n        'tagsfile': directives.unchanged,\n        'tagurlformat': directives.unchanged,\n    }\n    has_content = True\n\n    def run(self):\n        self.assert_has_content()\n        try:\n            lexer = get_lexer_by_name(self.arguments[0])\n        except ValueError:\n            # no lexer found - use the text one instead of an exception\n            lexer = TextLexer()\n\n        # Fetch the defaults\n        if pys.PYGMENTS_RST_OPTIONS is not None:\n            for k, v in six.iteritems(pys.PYGMENTS_RST_OPTIONS):\n                # Locally set options overrides the defaults\n                if k not in self.options:\n                    self.options[k] = v\n\n        if ('linenos' in self.options and\n                self.options['linenos'] not in ('table', 'inline')):\n            if self.options['linenos'] == 'none':\n                self.options.pop('linenos')\n            else:\n                self.options['linenos'] = 'table'\n\n        for flag in ('nowrap', 'nobackground', 'anchorlinenos'):\n            if flag in self.options:\n                self.options[flag] = True\n\n        # noclasses should already default to False, but just in case...\n        formatter = HtmlFormatter(noclasses=False, **self.options)\n        parsed = highlight('\\n'.join(self.content), lexer, formatter)\n        return [nodes.raw('', parsed, format='html')]\n\ndirectives.register_directive('code-block', Pygments)\ndirectives.register_directive('sourcecode', Pygments)\n\n\n_abbr_re = re.compile('\\((.*)\\)$', re.DOTALL)\n\n\nclass abbreviation(nodes.Inline, nodes.TextElement):\n    pass\n\n\ndef abbr_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):\n    text = utils.unescape(text)\n    m = _abbr_re.search(text)\n    if m is None:\n        return [abbreviation(text, text)], []\n    abbr = text[:m.start()].strip()\n    expl = m.group(1)\n    return [abbreviation(abbr, abbr, explanation=expl)], []\n\nroles.register_local_role('abbr', abbr_role)\n", "path": "pelican/rstdirectives.py"}]}