Skip to content

Preprocessor fails to parse an empty string #3

@svetlin-mladenov

Description

@svetlin-mladenov

Here is my testing code:

templates = {}
from mediawiki_parser.preprocessor import make_parser
preprocessor = make_parser(templates)
output = preprocessor.parse('')

The expected behavior is for the code to run without exceptions because an empty string is a valid media wiki page.

Instead the preprocessor.parse('') call fails with:

Match failure for pattern
   wikitext:(not_styled_text / styled_text / allowed_text / EOL)+
in source text at location
   index #0   line 1   character 1
   
   ^
Cannot match at least 1 time(s) pattern <?>:not_styled_text / styled_text / allowed_text / EOL.
(wrapped pattern error below)

... (and lots more)

The test fails even against the latest commit from master ( d7fa6ff )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions