Repository: pypa/readme_renderer (language: python)

Issue:
List numbering broken in README markdown files
<!--
    NOTE: This issue should be for problems with PyPI itself, including:
    * pypi.org
    * test.pypi.org
    * files.pythonhosted.org

    This issue should NOT be for a project installed from PyPI. If you are
    having an issue with a specific package, you should reach out to the
    maintainers of that project directly instead.

    Furthermore, this issue should NOT be for any non-PyPI properties (like
    python.org, docs.python.org, etc.)

    If your problem is related to search (a new or updated project doesn't
    appear in the PyPI search results), please wait for a couple of hours
    and check again before reporting it. The search index may take some
    time to be updated.
-->

**Describe the bug**
<!-- A clear and concise description the bug -->
Lists in README.md files don't have the expected numbering. It keeps resetting to `1.` where it shouldn't.

**Expected behavior**
<!-- A clear and concise description of what you expected to happen -->
Compare these two samples:
- https://gitlab.com/crimson.king/basketcase/-/blob/v0.0.6/README.md
- https://pypi.org/project/basketcase/0.0.6/

Why is PyPI parsing the same markdown differently?

**To Reproduce**
<!-- Steps to reproduce the bug, or a link to PyPI where the bug is visible -->
See samples above.

**My Platform**
<!--
    Any details about your specific platform:
    * If the problem is in the browser, what browser, version, and OS?
    * If the problem is with a command-line tool, what version of that tool?
    * If the problem is with connecting to PyPI, include some details about
      your network, including SSL/TLS implementation in use, internet service
      provider, and if there are any firewalls or proxies in use.
-->
Browser: Firefox 92.0

**Additional context**
<!-- Add any other context, links, etc. about the feature here. -->
PyPI:
![Captura de tela de 2021-09-18 13-07-58](https://user-images.githubusercontent.com/25424263/133895194-a24616e5-98b7-4653-b2ba-6382f86dc086.png)

GitLab:
![Captura de tela de 2021-09-18 13-08-10](https://user-images.githubusercontent.com/25424263/133895196-e1467149-acde-4663-9a85-634eaf64fad6.png)



Discussion / hints:

Fix patch:
diff --git a/readme_renderer/clean.py b/readme_renderer/clean.py
index 5727119..190f423 100644
--- a/readme_renderer/clean.py
+++ b/readme_renderer/clean.py
@@ -55,6 +55,7 @@
     "h6": ["align"],
     "code": ["class"],
     "p": ["align"],
+    "ol": ["start"],
     "input": ["type", "checked", "disabled"],
 }
 


Test patch:
diff --git a/tests/fixtures/test_GFM_025.html b/tests/fixtures/test_GFM_025.html
new file mode 100644
index 0000000..521dab7
--- /dev/null
+++ b/tests/fixtures/test_GFM_025.html
@@ -0,0 +1,12 @@
+<ol start="3">
+<li>Foo</li>
+</ol>
+<p>Some text</p>
+<ol start="2">
+<li>
+<p>Bar</p>
+</li>
+<li>
+<p>Baz</p>
+</li>
+</ol>
diff --git a/tests/fixtures/test_GFM_025.md b/tests/fixtures/test_GFM_025.md
new file mode 100644
index 0000000..4af260b
--- /dev/null
+++ b/tests/fixtures/test_GFM_025.md
@@ -0,0 +1,7 @@
+3. Foo
+
+Some text
+
+2. Bar
+
+1. Baz