getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.61k stars 1.81k forks source link

test_importer has an invalid pattern match; insert two missing spaces. #3376

Open egberts opened 4 months ago

egberts commented 4 months ago

Issue

In test_code_in_list() of tests/test_importer.py, the following line mismatched the file:

            sample_line = re.search(r"-   This is a code sample", md).group(0)

and its/tmp/tmpjg53eho1/code-in-list-test.md file derived from pelican/tests/content/wordpressexport.xml content:

...
<ul>
    <li>List Item One!</li>
    <li>List Item Two!</li>
<li>This is a code sample
<pre>
...

Better to replace a single space with /s+ regex pattern.

Platform

Click to expand ## Platform - **OS version and name**: Linux 6.1.0-21-amd64 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux - **Python version**: 3.11.2 - **Pelican version**: HEAD (513abbf) - **Link to theme**: [m.css](https://github.com/egberts/m.css) - **Links to plugins**: [pelican-plugins](https://github.com/getpelican/pelican-plugins) - **Link to your site**: n/a - **Link to your source**: n/a