| 242 | starttagopen = sgmllib.starttagopen |
| 243 | |
| 244 | class _EndBracketRegEx: |
| 245 | def __init__(self): |
| 246 | # Overriding the built-in sgmllib.endbracket regex allows the |
| 247 | # parser to find angle brackets embedded in element attributes. |
| 248 | self.endbracket = re.compile('''([^'"<>]|"[^"]*"(?=>|/|\s|\w+=)|'[^']*'(?=>|/|\s|\w+=))*(?=[<>])|.*?(?=[<>])''') |
| 249 | def search(self, target, index=0): |
| 250 | match = self.endbracket.match(target, index) |
| 251 | if match is not None: |
| 252 | # Returning a new object in the calling thread's context |
| 253 | # resolves a thread-safety. |
| 254 | return EndBracketMatch(match) |
| 255 | return None |
| 256 | class EndBracketMatch: |
| 257 | def __init__(self, match): |
| 258 | self.match = match |
no outgoing calls
no test coverage detected
searching dependent graphs…