| 196 | sticky_header_table_pattern = re.compile(r'^\s*</?StickyHeaderTable\s*/?>\s*$') |
| 197 | |
| 198 | def remove_sticky_header_table(text): |
| 199 | lines = text.split('\n') |
| 200 | result = [] |
| 201 | i = 0 |
| 202 | while i < len(lines): |
| 203 | if sticky_header_table_pattern.match(lines[i]): |
| 204 | prev_blank = len(result) > 0 and result[-1].strip() == '' |
| 205 | next_blank = i + 1 < len(lines) and lines[i + 1].strip() == '' |
| 206 | if prev_blank and next_blank: |
| 207 | i += 2 |
| 208 | else: |
| 209 | i += 1 |
| 210 | else: |
| 211 | result.append(lines[i]) |
| 212 | i += 1 |
| 213 | return '\n'.join(result) |
| 214 | |
| 215 | |
| 216 | # remove copyable snippet code |