- changelogs.html cleanup

  // skip build apk
This commit is contained in:
Hamza417
2023-09-22 00:53:35 +05:30
parent 8610d22319
commit ac5fb92795
3 changed files with 3081 additions and 3841 deletions

27
scripts/html_cleaner.py Normal file
View File

@ -0,0 +1,27 @@
from bs4 import BeautifulSoup
def replace_collapsible_tags_with_h2(html_file):
with open(html_file, 'r', encoding='utf-8') as file:
soup = BeautifulSoup(file, 'html.parser')
collapsible_divs = soup.find_all(class_='wrap-collapsible')
for div in collapsible_divs:
build_label = div.find(class_='lbl-toggle')
content = div.find(class_='content-inner')
if build_label and content:
build_number = build_label.get_text()
h2_tag = soup.new_tag('h2')
h2_tag.string = build_number
div.replace_with(h2_tag, content)
with open(html_file, 'w', encoding='utf-8') as file:
file.write(str(soup))
if __name__ == '__main__':
input_html_file = 'input.html' # Replace with your input HTML file
replace_collapsible_tags_with_h2(input_html_file)
print(f'Replaced collapsible tags with h2 tags in {input_html_file}')