ajustement tiret et apostrophe
This commit is contained in:
parent
21155e0517
commit
7248a8f01a
1 changed files with 5 additions and 1 deletions
6
main.py
6
main.py
|
@ -38,8 +38,12 @@ def make_bold_part(token):
|
|||
"""
|
||||
Makes bold text.
|
||||
"""
|
||||
if (not only_alphanumerics(token)) or len(token) <= 3:
|
||||
if re.search(r"\'", token[0:3]):
|
||||
return token
|
||||
elif only_alphanumerics(token) and len(token) <= 3:
|
||||
return f"**{token[0]}**{token[1:]}"
|
||||
elif (not only_alphanumerics(token)) and len(token) <= 3:
|
||||
return token
|
||||
else:
|
||||
mid_token = round(len(token)/2)
|
||||
return f"**{token[0:mid_token]}**{token[mid_token:]}"
|
||||
|
|
Loading…
Add table
Reference in a new issue