wikitextparser 0.55.12__tar.gz → 0.55.13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/CHANGELOG.rst +4 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/PKG-INFO +1 -1
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/__init__.py +1 -1
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_parser_function.py +1 -4
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_section.py +2 -2
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_wikitext.py +7 -19
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/.coveragerc +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/.github/workflows/tests.yml +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/.gitignore +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/.readthedocs.yaml +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/LICENSE.md +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/README.rst +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/docs/CHANGELOG.rst +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/docs/Makefile +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/docs/README.rst +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/docs/conf.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/docs/index.rst +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/docs/make.bat +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/pyproject.toml +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_argument.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_cell.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_comment_bold_italic.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_config.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_externallink.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_parameter.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_spans.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_table.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_tag.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_template.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_wikilink.py +0 -0
- {wikitextparser-0.55.12 → wikitextparser-0.55.13}/wikitextparser/_wikilist.py +0 -0
|
@@ -60,10 +60,7 @@ class SubWikiTextWithArgs(SubWikiText):
|
|
|
60
60
|
else:
|
|
61
61
|
arg_span = old_span
|
|
62
62
|
arg = Argument(lststr, type_to_spans, arg_span, type_, self)
|
|
63
|
-
arg.
|
|
64
|
-
lststr[0][s:e],
|
|
65
|
-
shadow[arg_self_start:arg_self_end],
|
|
66
|
-
)
|
|
63
|
+
arg._span_data[3] = shadow[arg_self_start:arg_self_end]
|
|
67
64
|
arguments_append(arg)
|
|
68
65
|
return arguments
|
|
69
66
|
|
|
@@ -42,9 +42,9 @@ class Section(SubWikiText):
|
|
|
42
42
|
if level_diff == 0:
|
|
43
43
|
return
|
|
44
44
|
if level_diff < 0:
|
|
45
|
-
new_equals = '=' *
|
|
45
|
+
new_equals = '=' * -level_diff
|
|
46
46
|
self.insert(0, new_equals)
|
|
47
|
-
self.insert(m.end(2)
|
|
47
|
+
self.insert(m.end(2) - level_diff, new_equals)
|
|
48
48
|
return
|
|
49
49
|
del self[:level_diff]
|
|
50
50
|
del self[m.end(2) : m.end(2) + level_diff]
|
|
@@ -40,7 +40,6 @@ from ._spans import (
|
|
|
40
40
|
END_TAG_PATTERN,
|
|
41
41
|
EXTERNAL_LINK_URL_TAIL,
|
|
42
42
|
INVALID_URL_CHARS,
|
|
43
|
-
PARSABLE_TAG_EXTENSION_NAME,
|
|
44
43
|
START_TAG_PATTERN,
|
|
45
44
|
parse_to_spans,
|
|
46
45
|
rc,
|
|
@@ -52,10 +51,6 @@ NAME_CAPTURING_HTML_START_TAG_FINDITER = rc(
|
|
|
52
51
|
)
|
|
53
52
|
).finditer
|
|
54
53
|
|
|
55
|
-
PARSABLE_TAG_EXTENSIONS_MATCH = rc(
|
|
56
|
-
rb'<' + PARSABLE_TAG_EXTENSION_NAME + rb'\b', IGNORECASE
|
|
57
|
-
).match
|
|
58
|
-
|
|
59
54
|
# External links
|
|
60
55
|
BRACKET_EXTERNAL_LINK_SCHEMES = regex_pattern(
|
|
61
56
|
_bare_external_link_schemes | {'//'}
|
|
@@ -113,11 +108,7 @@ TABLE_FINDITER = rc(
|
|
|
113
108
|
DOTALL | MULTILINE | VERBOSE,
|
|
114
109
|
).finditer
|
|
115
110
|
|
|
116
|
-
substitute_apostrophes = rc(
|
|
117
|
-
rb"('\0*+){2,}+(?=[^']|$)",
|
|
118
|
-
MULTILINE | VERBOSE,
|
|
119
|
-
).sub
|
|
120
|
-
find_lines = rc(rb'(.*?)$').finditer
|
|
111
|
+
substitute_apostrophes = rc(rb"('\0*+){2,}+(?=[^']|$)", MULTILINE).sub
|
|
121
112
|
|
|
122
113
|
BOLD_FINDITER = rc(
|
|
123
114
|
rb"""
|
|
@@ -213,7 +204,7 @@ class WikiText:
|
|
|
213
204
|
# The following class attribute acts as a default value.
|
|
214
205
|
_type = 'WikiText'
|
|
215
206
|
|
|
216
|
-
__slots__ = '_type_to_spans', '_lststr', '_span_data'
|
|
207
|
+
__slots__ = '_type_to_spans', '_lststr', '_span_data'
|
|
217
208
|
|
|
218
209
|
def __init__(
|
|
219
210
|
self,
|
|
@@ -241,7 +232,6 @@ class WikiText:
|
|
|
241
232
|
if _type not in SPAN_PARSER_TYPES:
|
|
242
233
|
type_to_spans = self._type_to_spans = parse_to_spans(byte_array)
|
|
243
234
|
type_to_spans[_type] = [span]
|
|
244
|
-
self._shadow_cache = string, byte_array
|
|
245
235
|
else:
|
|
246
236
|
# In SPAN_PARSER_TYPES, we can't pass the original byte_array to
|
|
247
237
|
# parser to generate the shadow because it will replace the whole
|
|
@@ -259,7 +249,6 @@ class WikiText:
|
|
|
259
249
|
byte_array[0] = 3
|
|
260
250
|
byte_array[-1] = 32
|
|
261
251
|
type_to_spans = parse_to_spans(byte_array)
|
|
262
|
-
self._shadow_cache = string, byte_array
|
|
263
252
|
type_to_spans[_type].insert(0, span)
|
|
264
253
|
self._type_to_spans = type_to_spans
|
|
265
254
|
if type(self) is Parameter:
|
|
@@ -1072,12 +1061,11 @@ class WikiText:
|
|
|
1072
1061
|
s = starts[1]
|
|
1073
1062
|
append_bold_start(s)
|
|
1074
1063
|
return b'_' * (s - starts[0]) + m.string[s : m.end()]
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
raise # execution should never reach here
|
|
1064
|
+
# more than 5 apostrophes -> hide the prior ones
|
|
1065
|
+
odd_bold_italics ^= True
|
|
1066
|
+
odd_italics ^= True
|
|
1067
|
+
s = starts[-5]
|
|
1068
|
+
return b'_' * (s - starts[0]) + m.string[s : m.end()]
|
|
1081
1069
|
|
|
1082
1070
|
return bytearray(b'\n').join(
|
|
1083
1071
|
[
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|