Repository: dbt-labs/dbt-core

Issue:
Block parser mismatched with jinja: docs blocks
### Describe the bug
I don't _totally_ understand the nature of this error, but it appears to be an internal error. Given a `.md` file like:

```
{%- docs doc1 -%}

    {% raw %}

    ```sql
        {{ doc_ex_1(date_column='i.date_sk', time_column='i.time_sk') }}
    ```

    {% endraw %}

{%- enddocs -%}


{%- docs doc2 -%}

    {% raw %}

    ```sql
        {{ doc_ex_2(date_column='i.date_sk', time_column='i.time_sk') }}
    ```

    {% endraw %}

{%- enddocs -%}
```

Calling `dbt docs generate` will result in:
```
Got 2 docs in an extracted docs block: block parser mismatched with jinja
```

I _think_ this might have something to do with the `raw` tags in this example file.

**The output of `dbt --version`:**
```
0.16.0
```


Discussion:

Resolving patch:
diff --git a/core/dbt/clients/_jinja_blocks.py b/core/dbt/clients/_jinja_blocks.py
--- a/core/dbt/clients/_jinja_blocks.py
+++ b/core/dbt/clients/_jinja_blocks.py
@@ -69,7 +69,7 @@ def end_pat(self):
 
 RAW_BLOCK_PATTERN = regex(''.join((
     r'(?:\s*\{\%\-|\{\%)\s*raw\s*(?:\-\%\}\s*|\%\})',
-    r'(?:.*)',
+    r'(?:.*?)',
     r'(?:\s*\{\%\-|\{\%)\s*endraw\s*(?:\-\%\}\s*|\%\})',
 )))
 


Test patch:
diff --git a/test/unit/test_docs_blocks.py b/test/unit/test_docs_blocks.py
--- a/test/unit/test_docs_blocks.py
+++ b/test/unit/test_docs_blocks.py
@@ -64,6 +64,25 @@
 )
 
 
+MULTIPLE_RAW_BLOCKS = r'''
+{% docs some_doc %}
+{% raw %}
+    ```
+    {% docs %}some doc{% enddocs %}
+    ```
+{% endraw %}
+{% enddocs %}
+
+{% docs other_doc %}
+{% raw %}
+    ```
+    {% docs %}other doc{% enddocs %}
+    ```
+{% endraw %}
+{% enddocs %}
+'''
+
+
 class DocumentationParserTest(unittest.TestCase):
     def setUp(self):
         if os.name == 'nt':
@@ -164,3 +183,28 @@ def test_load_file_extras(self):
             self.assertIsInstance(result, ParsedDocumentation)
         self.assertEqual(results[0].name, 'snowplow_sessions')
         self.assertEqual(results[1].name, 'snowplow_sessions__session_id')
+
+    def test_multiple_raw_blocks(self):
+        parser = docs.DocumentationParser(
+            results=ParseResult.rpc(),
+            root_project=self.root_project_config,
+            project=self.subdir_project_config,
+            macro_manifest=Manifest.from_macros())
+
+        file_block = self._build_file(MULTIPLE_RAW_BLOCKS, 'test_file.md')
+
+        parser.parse_file(file_block)
+        results = sorted(parser.results.docs.values(), key=lambda n: n.name)
+        self.assertEqual(len(results), 2)
+        for result in results:
+            self.assertIsInstance(result, ParsedDocumentation)
+            self.assertEqual(result.package_name, 'some_package')
+            self.assertEqual(result.original_file_path, self.testfile_path)
+            self.assertEqual(result.root_path, self.subdir_path)
+            self.assertEqual(result.resource_type, NodeType.Documentation)
+            self.assertEqual(result.path, 'test_file.md')
+
+        self.assertEqual(results[0].name, 'other_doc')
+        self.assertEqual(results[0].block_contents, '```\n    {% docs %}other doc{% enddocs %}\n    ```')
+        self.assertEqual(results[1].name, 'some_doc')
+        self.assertEqual(results[1].block_contents, '```\n    {% docs %}some doc{% enddocs %}\n    ```', )