21 lines
632 B
Python
21 lines
632 B
Python
import re
|
|
|
|
with open('tmp_header.html', 'r') as f:
|
|
content = f.read()
|
|
|
|
new_header = '''<!-- wp:group {"style":{"spacing":{"blockGap":"0px"}}} -->
|
|
<div class="wp-block-group">
|
|
<!-- wp:site-title {"level":1,"style":{"typography":{"fontSize":"54px","lineHeight":"1.05","fontStyle":"normal","fontWeight":"700"},"color":{"text":"#316263"}}} /-->
|
|
</div>
|
|
<!-- /wp:group -->'''
|
|
|
|
content = re.sub(
|
|
r'<!-- wp:group \{"style":\{"spacing":\{"blockGap":"0px"\}\}\}.*?<!-- /wp:group -->',
|
|
new_header,
|
|
content,
|
|
count=1,
|
|
flags=re.IGNORECASE | re.DOTALL
|
|
)
|
|
|
|
with open('tmp_header_updated.html', 'w') as f:
|
|
f.write(content) |