-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchromium-99.0.4844.84-markdownsafe-soft_str.patch
149 lines (124 loc) · 5.31 KB
/
chromium-99.0.4844.84-markdownsafe-soft_str.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
diff -up chromium-104.0.5112.101/third_party/blink/renderer/bindings/scripts/generate_bindings.pydeps.10~ chromium-104.0.5112.101/third_party/blink/renderer/bindings/scripts/generate_bindings.pydeps
--- chromium-104.0.5112.101/third_party/blink/renderer/bindings/scripts/generate_bindings.pydeps.10~ 2022-08-25 00:40:12.143913366 +0200
+++ chromium-104.0.5112.101/third_party/blink/renderer/bindings/scripts/generate_bindings.pydeps 2022-08-25 00:41:31.994664680 +0200
@@ -17,7 +17,6 @@
../../../../mako/mako/mako/template.py
../../../../mako/mako/mako/util.py
../../../../markupsafe/__init__.py
-../../../../markupsafe/_compat.py
../../../../markupsafe/_native.py
../../../../pyjson5/src/json5/__init__.py
../../../../pyjson5/src/json5/lib.py
diff -up chromium-104.0.5112.101/third_party/jinja2/filters.py.10~ chromium-104.0.5112.101/third_party/jinja2/filters.py
--- chromium-104.0.5112.101/third_party/jinja2/filters.py.10~ 2022-08-17 01:29:39.000000000 +0200
+++ chromium-104.0.5112.101/third_party/jinja2/filters.py 2022-08-25 00:40:12.141913373 +0200
@@ -10,7 +10,7 @@ from itertools import groupby
from markupsafe import escape
from markupsafe import Markup
-from markupsafe import soft_unicode
+from markupsafe import soft_str
from ._compat import abc
from ._compat import imap
@@ -191,18 +191,18 @@ def do_replace(eval_ctx, s, old, new, co
):
s = escape(s)
else:
- s = soft_unicode(s)
- return s.replace(soft_unicode(old), soft_unicode(new), count)
+ s = soft_str(s)
+ return s.replace(soft_str(old), soft_str(new), count)
def do_upper(s):
"""Convert a value to uppercase."""
- return soft_unicode(s).upper()
+ return soft_str(s).upper()
def do_lower(s):
"""Convert a value to lowercase."""
- return soft_unicode(s).lower()
+ return soft_str(s).lower()
@evalcontextfilter
@@ -245,7 +245,7 @@ def do_capitalize(s):
"""Capitalize a value. The first character will be uppercase, all others
lowercase.
"""
- return soft_unicode(s).capitalize()
+ return soft_str(s).capitalize()
def do_title(s):
@@ -255,7 +255,7 @@ def do_title(s):
return "".join(
[
item[0].upper() + item[1:].lower()
- for item in _word_beginning_split_re.split(soft_unicode(s))
+ for item in _word_beginning_split_re.split(soft_str(s))
if item
]
)
@@ -495,7 +495,7 @@ def do_join(eval_ctx, value, d=u"", attr
return d.join(value)
# no html involved, to normal joining
- return soft_unicode(d).join(imap(soft_unicode, value))
+ return soft_str(d).join(imap(soft_str, value))
def do_center(value, width=80):
@@ -761,7 +761,7 @@ def do_wordwrap(
def do_wordcount(s):
"""Count the words in that string."""
- return len(_word_re.findall(soft_unicode(s)))
+ return len(_word_re.findall(soft_str(s)))
def do_int(value, default=0, base=10):
@@ -820,12 +820,12 @@ def do_format(value, *args, **kwargs):
raise FilterArgumentError(
"can't handle positional and keyword arguments at the same time"
)
- return soft_unicode(value) % (kwargs or args)
+ return soft_str(value) % (kwargs or args)
def do_trim(value, chars=None):
"""Strip leading and trailing characters, by default whitespace."""
- return soft_unicode(value).strip(chars)
+ return soft_str(value).strip(chars)
def do_striptags(value):
@@ -1365,7 +1365,7 @@ FILTERS = {
"selectattr": do_selectattr,
"slice": do_slice,
"sort": do_sort,
- "string": soft_unicode,
+ "string": soft_str,
"striptags": do_striptags,
"sum": do_sum,
"title": do_title,
diff -up chromium-104.0.5112.101/third_party/jinja2/runtime.py.10~ chromium-104.0.5112.101/third_party/jinja2/runtime.py
--- chromium-104.0.5112.101/third_party/jinja2/runtime.py.10~ 2022-08-17 01:29:39.000000000 +0200
+++ chromium-104.0.5112.101/third_party/jinja2/runtime.py 2022-08-25 00:40:12.142913370 +0200
@@ -6,7 +6,7 @@ from types import MethodType
from markupsafe import escape # noqa: F401
from markupsafe import Markup
-from markupsafe import soft_unicode
+from markupsafe import soft_str
from ._compat import abc
from ._compat import imap
@@ -62,7 +62,7 @@ def identity(x):
def markup_join(seq):
"""Concatenation that escapes if necessary and converts to unicode."""
buf = []
- iterator = imap(soft_unicode, seq)
+ iterator = imap(soft_str, seq)
for arg in iterator:
buf.append(arg)
if hasattr(arg, "__html__"):
diff -up chromium-104.0.5112.101/third_party/jinja2/utils.py.10~ chromium-104.0.5112.101/third_party/jinja2/utils.py
--- chromium-104.0.5112.101/third_party/jinja2/utils.py.10~ 2022-08-17 01:29:39.000000000 +0200
+++ chromium-104.0.5112.101/third_party/jinja2/utils.py 2022-08-25 00:40:12.142913370 +0200
@@ -725,13 +725,13 @@ except SyntaxError:
have_async_gen = False
-def soft_unicode(s):
- from markupsafe import soft_unicode
+def soft_str(s):
+ from markupsafe import soft_str
warnings.warn(
- "'jinja2.utils.soft_unicode' will be removed in version 3.0."
- " Use 'markupsafe.soft_unicode' instead.",
+ "'jinja2.utils.soft_str' will be removed in version 3.0."
+ " Use 'markupsafe.soft_str' instead.",
DeprecationWarning,
stacklevel=2,
)
- return soft_unicode(s)
+ return soft_str(s)