Repository: facelessuser/pymdown-extensions

Issue:
Code block snippet lines render blank code block, when it's just the first line 
### Description

When I embed a snippet in a code snippet, restricting the lines to `:1:1`, the code block is rendered empty. This can temporarily be fixed by writing `::1` (which should be equivalent), so it's not urgent or anything, but I thought, you might want to fix that.

### Minimal Reproduction

1. Create the following code block:
```pony
--8<-- "some-code-snippet-file-path.pony:1:1"
```
2. Build your site and check the result for the code block

### Version(s) & System Info

- Operating System: ¯\\\_(ツ)\_/¯ 
- Python Version: 3.8
- Package Version: 10.8

Discussion:
facelessuser: @gir-bot lgtm

Patch:
diff --git a/docs/src/markdown/about/changelog.md b/docs/src/markdown/about/changelog.md
index 5265ffb0..b617548a 100644
--- a/docs/src/markdown/about/changelog.md
+++ b/docs/src/markdown/about/changelog.md
@@ -1,5 +1,9 @@
 # Changelog
 
+## 10.8.1
+
+-   **FIX**: Snippets: Fix snippet line range with a start of line 1.
+
 ## 10.8
 
 -   **NEW**: Require Python Markdown 3.6+.
diff --git a/pymdownx/__meta__.py b/pymdownx/__meta__.py
index bf2cda00..d58ff9f7 100644
--- a/pymdownx/__meta__.py
+++ b/pymdownx/__meta__.py
@@ -185,5 +185,5 @@ def parse_version(ver, pre=False):
     return Version(major, minor, micro, release, pre, post, dev)
 
 
-__version_info__ = Version(10, 8, 0, "final")
+__version_info__ = Version(10, 8, 1, "final")
 __version__ = __version_info__._get_canonical()
diff --git a/pymdownx/snippets.py b/pymdownx/snippets.py
index dbb1e537..58aada02 100644
--- a/pymdownx/snippets.py
+++ b/pymdownx/snippets.py
@@ -292,7 +292,7 @@ class SnippetPreprocessor(Preprocessor):
                     end = int(ending[1:])
                 starting = m.group(2)
                 if starting and len(starting) > 1:
-                    start = max(1, int(starting[1:]) - 1)
+                    start = max(0, int(starting[1:]) - 1)
                 section_name = m.group(4)
                 if section_name:
                     section = section_name[1:]


Test patch:
diff --git a/tests/test_extensions/test_snippets.py b/tests/test_extensions/test_snippets.py
index 80410345..3a792efb 100644
--- a/tests/test_extensions/test_snippets.py
+++ b/tests/test_extensions/test_snippets.py
@@ -209,6 +209,33 @@ class TestSnippets(util.MdCase):
             True
         )
 
+    def test_start_1_1(self):
+        """Test beginning of file, single line range."""
+
+        self.check_markdown(
+            R'''
+            ---8<--- "lines.txt:1:1"
+            ''',
+            '''
+            <p>This is a multi-line</p>
+            ''',
+            True
+        )
+
+    def test_start_1_2(self):
+        """Test beginning of file span of multiple lines."""
+
+        self.check_markdown(
+            R'''
+            ---8<--- "lines.txt:1:2"
+            ''',
+            '''
+            <p>This is a multi-line
+            snippet.</p>
+            ''',
+            True
+        )
+
     def test_end_line_inline(self):
         """Test ending line with inline syntax."""