Skip to content

markdown: improve preprocessors type #4588

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

Merged
merged 2 commits into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions third_party/2and3/markdown/preprocessors.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Any, Pattern
from typing import Any, Iterable, List, Pattern

from . import util

def build_preprocessors(md, **kwargs): ...

class Preprocessor(util.Processor):
def run(self, lines) -> None: ...
def run(self, lines: List[str]) -> List[str]: ...

class NormalizeWhitespace(Preprocessor):
def run(self, lines): ...
def run(self, lines: Iterable[str]) -> List[str]: ...

class HtmlBlockPreprocessor(Preprocessor):
right_tag_patterns: Any
Expand All @@ -17,10 +17,10 @@ class HtmlBlockPreprocessor(Preprocessor):
attrs_re: Any
left_tag_re: Any
markdown_in_raw: bool = ...
def run(self, lines): ...
def run(self, lines: Iterable[str]) -> List[str]: ...

class ReferencePreprocessor(Preprocessor):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class doesn't exist in the file you linked to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, looks like it got removed eight days ago, changes haven't been released

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good timing. Out of scope for this PR then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what it's worth it looks like this one actually did need a List

TITLE: str = ...
RE: Pattern
TITLE_RE: Pattern
def run(self, lines): ...
def run(self, lines: List[str]) -> List[str]: ...