mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 04:20:30 +00:00
start
This commit is contained in:
parent
3336bbf1a4
commit
702a10795b
2 changed files with 40 additions and 0 deletions
18
update_json.py
Normal file
18
update_json.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import json
|
||||
import re
|
||||
import requests
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
def prepare_description(text):
|
||||
text = re.sub('<[^<]+?>', '', text) # Remove HTML tags
|
||||
text = re.sub(r'#{1,6}\s?', '', text) # Remove markdown header tags
|
||||
text = re.sub(r'\*{2}', '', text) # Remove all occurrences of two consecutive asterisks
|
||||
text = re.sub(r'(?<=\r|\n)-', '•', text) # Only replace - with • if it is preceded by \r or \n
|
||||
text = re.sub(r'`', '"', text) # Replace ` with "
|
||||
text = re.sub(r'\r\n\r\n', '\r \n', text) # Replace \r\n\r\n with \r \n (avoid incorrect display of the description regarding paragraphs)
|
||||
return text
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue