Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocessor fails to parse an empty string #3

Open
svetlin-mladenov opened this issue Nov 26, 2016 · 0 comments
Open

Preprocessor fails to parse an empty string #3

svetlin-mladenov opened this issue Nov 26, 2016 · 0 comments

Comments

@svetlin-mladenov
Copy link

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 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant