mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-22 20:01:29 +08:00
Various improvements to Markdown stubs (#10008)
This commit is contained in:
@@ -8,5 +8,4 @@ markdown.extensions.footnotes.TABBED_RE
|
||||
markdown.extensions.legacy_attrs.LegacyAttrs.run
|
||||
markdown.extensions.toc.TocTreeprocessor.run
|
||||
markdown.extensions.toc.slugify
|
||||
markdown.preprocessors.ReferencePreprocessor
|
||||
markdown.postprocessors.UnescapePostprocessor # deprecated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from logging import Logger
|
||||
from re import Match, Pattern
|
||||
from typing import Any
|
||||
from typing import Any, ClassVar
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
from markdown import Markdown
|
||||
@@ -36,10 +36,10 @@ class BlockQuoteProcessor(BlockProcessor):
|
||||
def clean(self, line: str) -> str: ...
|
||||
|
||||
class OListProcessor(BlockProcessor):
|
||||
TAG: str = ...
|
||||
STARTSWITH: str = ...
|
||||
LAZY_OL: bool = ...
|
||||
SIBLING_TAGS: list[str]
|
||||
TAG: ClassVar[str]
|
||||
STARTSWITH: ClassVar[str]
|
||||
LAZY_OL: ClassVar[bool]
|
||||
SIBLING_TAGS: ClassVar[list[str]]
|
||||
RE: Pattern[str]
|
||||
CHILD_RE: Pattern[str]
|
||||
INDENT_RE: Pattern[str]
|
||||
@@ -47,24 +47,22 @@ class OListProcessor(BlockProcessor):
|
||||
def get_items(self, block: str) -> list[str]: ...
|
||||
|
||||
class UListProcessor(OListProcessor):
|
||||
TAG: str = ...
|
||||
RE: Pattern[str]
|
||||
def __init__(self, parser: BlockParser) -> None: ...
|
||||
|
||||
class HashHeaderProcessor(BlockProcessor):
|
||||
RE: Pattern[str]
|
||||
RE: ClassVar[Pattern[str]]
|
||||
|
||||
class SetextHeaderProcessor(BlockProcessor):
|
||||
RE: Pattern[str]
|
||||
RE: ClassVar[Pattern[str]]
|
||||
|
||||
class HRProcessor(BlockProcessor):
|
||||
RE: str = ...
|
||||
SEARCH_RE: Pattern[str]
|
||||
RE: ClassVar[str]
|
||||
SEARCH_RE: ClassVar[Pattern[str]]
|
||||
match: Match[str]
|
||||
|
||||
class EmptyBlockProcessor(BlockProcessor): ...
|
||||
|
||||
class ReferenceProcessor(BlockProcessor):
|
||||
RE: Pattern[str]
|
||||
RE: ClassVar[Pattern[str]]
|
||||
|
||||
class ParagraphProcessor(BlockProcessor): ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any
|
||||
from markdown.core import Markdown
|
||||
|
||||
class Extension:
|
||||
config: Mapping[str, list[Any]] = ...
|
||||
config: Mapping[str, list[Any]]
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
def getConfig(self, key: str, default: Any = "") -> Any: ...
|
||||
def getConfigs(self) -> dict[str, Any]: ...
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from _typeshed import Incomplete
|
||||
from re import Pattern
|
||||
from typing import Any
|
||||
from typing import ClassVar
|
||||
|
||||
from markdown.extensions import Extension
|
||||
from markdown.preprocessors import Preprocessor
|
||||
@@ -7,11 +8,8 @@ from markdown.preprocessors import Preprocessor
|
||||
class FencedCodeExtension(Extension): ...
|
||||
|
||||
class FencedBlockPreprocessor(Preprocessor):
|
||||
FENCED_BLOCK_RE: Pattern[str]
|
||||
CODE_WRAP: str = ...
|
||||
LANG_TAG: str = ...
|
||||
checked_for_codehilite: bool = ...
|
||||
codehilite_conf: Any
|
||||
FENCED_BLOCK_RE: ClassVar[Pattern[str]]
|
||||
codehilite_conf: dict[Incomplete, Incomplete]
|
||||
def __init__(self, md) -> None: ...
|
||||
|
||||
def makeExtension(**kwargs): ...
|
||||
|
||||
@@ -15,7 +15,7 @@ TABBED_RE: Pattern[str]
|
||||
RE_REF_ID: Any
|
||||
|
||||
class FootnoteExtension(Extension):
|
||||
unique_prefix: int = ...
|
||||
unique_prefix: int
|
||||
found_refs: Any
|
||||
used_refs: Any
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
@@ -46,7 +46,7 @@ class FootnotePostTreeprocessor(Treeprocessor):
|
||||
def add_duplicates(self, li, duplicates) -> None: ...
|
||||
def get_num_duplicates(self, li): ...
|
||||
def handle_duplicates(self, parent) -> None: ...
|
||||
offset: int = ...
|
||||
offset: int
|
||||
|
||||
class FootnoteTreeprocessor(Treeprocessor):
|
||||
footnotes: Any
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any
|
||||
from re import Pattern
|
||||
from typing import ClassVar
|
||||
|
||||
from markdown.blockprocessors import BlockProcessor
|
||||
from markdown.extensions import Extension
|
||||
@@ -8,10 +9,10 @@ PIPE_LEFT: int
|
||||
PIPE_RIGHT: int
|
||||
|
||||
class TableProcessor(BlockProcessor):
|
||||
RE_CODE_PIPES: Any
|
||||
RE_END_BORDER: Any
|
||||
border: bool = ...
|
||||
separator: str = ...
|
||||
RE_CODE_PIPES: ClassVar[Pattern[str]]
|
||||
RE_END_BORDER: ClassVar[Pattern[str]]
|
||||
border: bool
|
||||
separator: str
|
||||
def __init__(self, parser, config) -> None: ...
|
||||
|
||||
class TableExtension(Extension): ...
|
||||
|
||||
@@ -27,7 +27,7 @@ class TocTreeprocessor(Treeprocessor):
|
||||
permalink_class: Any
|
||||
permalink_title: Any
|
||||
header_rgx: Any
|
||||
toc_top: int = ...
|
||||
toc_top: int
|
||||
toc_bottom: Any
|
||||
def __init__(self, md, config) -> None: ...
|
||||
def iterparent(self, node) -> None: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
from re import Match
|
||||
from typing import Any, ClassVar
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any, ClassVar, NamedTuple
|
||||
from xml.etree.ElementTree import Element
|
||||
|
||||
from markdown.core import Markdown
|
||||
@@ -33,23 +33,28 @@ LINE_BREAK_RE: str
|
||||
|
||||
def dequote(string): ...
|
||||
|
||||
class EmStrongItem: ...
|
||||
class _EmStrongItemBase(NamedTuple):
|
||||
pattern: re.Pattern[str]
|
||||
builder: str
|
||||
tags: str
|
||||
|
||||
class EmStrongItem(_EmStrongItemBase): ...
|
||||
|
||||
class Pattern:
|
||||
ANCESTOR_EXCLUDES: Any
|
||||
ANCESTOR_EXCLUDES: ClassVar[tuple[Incomplete, ...]]
|
||||
pattern: Any
|
||||
compiled_re: Any
|
||||
compiled_re: re.Pattern[str]
|
||||
md: Markdown
|
||||
def __init__(self, pattern, md: Markdown | None = None) -> None: ...
|
||||
def getCompiledRegExp(self): ...
|
||||
def handleMatch(self, m: Match[str]) -> str | Element | None: ...
|
||||
def handleMatch(self, m: re.Match[str]) -> str | Element | None: ...
|
||||
def type(self): ...
|
||||
def unescape(self, text): ...
|
||||
|
||||
class InlineProcessor(Pattern):
|
||||
safe_mode: bool = ...
|
||||
safe_mode: bool
|
||||
def __init__(self, pattern, md: Markdown | None = None) -> None: ...
|
||||
def handleMatch(self, m: Match[str], data) -> tuple[Element, int, int] | tuple[None, None, None]: ... # type: ignore[override]
|
||||
def handleMatch(self, m: re.Match[str], data) -> tuple[Element, int, int] | tuple[None, None, None]: ... # type: ignore[override]
|
||||
|
||||
class SimpleTextPattern(Pattern): ...
|
||||
class SimpleTextInlineProcessor(InlineProcessor): ...
|
||||
@@ -68,7 +73,7 @@ class SubstituteTagInlineProcessor(SimpleTagInlineProcessor): ...
|
||||
|
||||
class BacktickInlineProcessor(InlineProcessor):
|
||||
ESCAPED_BSLASH: Any
|
||||
tag: str = ...
|
||||
tag: str
|
||||
def __init__(self, pattern) -> None: ...
|
||||
|
||||
class DoubleTagPattern(SimpleTagPattern): ...
|
||||
@@ -76,19 +81,18 @@ class DoubleTagInlineProcessor(SimpleTagInlineProcessor): ...
|
||||
class HtmlInlineProcessor(InlineProcessor): ...
|
||||
|
||||
class AsteriskProcessor(InlineProcessor):
|
||||
PATTERNS: Any
|
||||
PATTERNS: ClassVar[list[EmStrongItem]]
|
||||
def build_single(self, m, tag, idx): ...
|
||||
def build_double(self, m, tags, idx): ...
|
||||
def build_double2(self, m, tags, idx): ...
|
||||
def parse_sub_patterns(self, data, parent, last, idx) -> None: ...
|
||||
def build_element(self, m, builder, tags, index): ...
|
||||
|
||||
class UnderscoreProcessor(AsteriskProcessor):
|
||||
PATTERNS: Any
|
||||
class UnderscoreProcessor(AsteriskProcessor): ...
|
||||
|
||||
class LinkInlineProcessor(InlineProcessor):
|
||||
RE_LINK: Any
|
||||
RE_TITLE_CLEAN: Any
|
||||
RE_LINK: ClassVar[re.Pattern[str]]
|
||||
RE_TITLE_CLEAN: ClassVar[re.Pattern[str]]
|
||||
def getLink(self, data, index): ...
|
||||
def getText(self, data, index): ...
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from re import Pattern
|
||||
from typing import Any
|
||||
|
||||
from . import util
|
||||
@@ -12,13 +11,8 @@ class NormalizeWhitespace(Preprocessor): ...
|
||||
|
||||
class HtmlBlockPreprocessor(Preprocessor):
|
||||
right_tag_patterns: Any
|
||||
attrs_pattern: str = ...
|
||||
attrs_pattern: str
|
||||
left_tag_pattern: Any
|
||||
attrs_re: Any
|
||||
left_tag_re: Any
|
||||
markdown_in_raw: bool = ...
|
||||
|
||||
class ReferencePreprocessor(Preprocessor):
|
||||
TITLE: str = ...
|
||||
RE: Pattern[str]
|
||||
TITLE_RE: Pattern[str]
|
||||
markdown_in_raw: bool
|
||||
|
||||
@@ -27,9 +27,9 @@ class Processor:
|
||||
def __init__(self, md: Markdown | None = None) -> None: ...
|
||||
|
||||
class HtmlStash:
|
||||
html_counter: int = ...
|
||||
html_counter: int
|
||||
rawHtmlBlocks: list[str]
|
||||
tag_counter: int = ...
|
||||
tag_counter: int
|
||||
tag_data: list[dict[str, Any]]
|
||||
def __init__(self) -> None: ...
|
||||
def store(self, html: str) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user