Browse Source

intermediate changes
ref:56a8fc047a6219a99d08b5290f538eadde605502

arcadia-devtools 2 years ago
parent
commit
fb2415cc58

+ 1 - 0
build/rules/autocheck.blacklist

@@ -34,3 +34,4 @@ ci/registry
 market/front/apps
 classifieds/verticals-backend
 classifieds/schema-registry
+devtools/experimental/repo/REPO-33/torture

+ 1 - 1
build/ymake.core.conf

@@ -10,7 +10,7 @@ FAKEID=3141592653
 
 SANDBOX_FAKEID=${FAKEID}.7600000
 CPP_FAKEID=9278195
-GO_FAKEID=9056219
+GO_FAKEID=9300436
 ANDROID_FAKEID=8821472
 CLANG_TIDY_FAKEID=8625699
 

+ 1 - 1
contrib/python/MarkupSafe/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: MarkupSafe
-Version: 2.1.0
+Version: 2.1.1
 Summary: Safely add untrusted strings to HTML/XML markup.
 Home-page: https://palletsprojects.com/p/markupsafe/
 Author: Armin Ronacher

+ 8 - 4
contrib/python/MarkupSafe/py3/markupsafe/__init__.py

@@ -11,9 +11,10 @@ if t.TYPE_CHECKING:
             pass
 
 
-__version__ = "2.1.0"
+__version__ = "2.1.1"
 
-_striptags_re = re.compile(r"(<!--.*?-->|<[^>]*>)")
+_strip_comments_re = re.compile(r"<!--.*?-->")
+_strip_tags_re = re.compile(r"<.*?>")
 
 
 def _simple_escaping_wrapper(name: str) -> t.Callable[..., "Markup"]:
@@ -158,8 +159,11 @@ class Markup(str):
         >>> Markup("Main &raquo;\t<em>About</em>").striptags()
         'Main » About'
         """
-        stripped = " ".join(_striptags_re.sub("", self).split())
-        return Markup(stripped).unescape()
+        # Use two regexes to avoid ambiguous matches.
+        value = _strip_comments_re.sub("", self)
+        value = _strip_tags_re.sub("", value)
+        value = " ".join(value.split())
+        return Markup(value).unescape()
 
     @classmethod
     def escape(cls, s: t.Any) -> "Markup":

+ 9 - 1
contrib/python/MarkupSafe/py3/tests/test_markupsafe.py

@@ -69,7 +69,15 @@ def test_dict_interpol():
 
 def test_escaping(escape):
     assert escape("\"<>&'") == "&#34;&lt;&gt;&amp;&#39;"
-    assert Markup("<em>Foo &amp; Bar</em>").striptags() == "Foo & Bar"
+    assert (
+        Markup(
+            "<!-- outer comment -->"
+            "<em>Foo &amp; Bar"
+            "<!-- inner comment about <em> -->"
+            "</em>"
+        ).striptags()
+        == "Foo & Bar"
+    )
 
 
 def test_unescape():