We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
as a example (from chat GPT)
import re
def convert_markdown_to_mrkdwn(markdown_text): # Convert headers markdown_text = re.sub(r'(^|\n)### (.)', r'\1 \2*\n', markdown_text) markdown_text = re.sub(r'(^|\n)## (.)', r'\1** \2**\n', markdown_text) markdown_text = re.sub(r'(^|\n)# (.)', r'\1*** \2***\n', markdown_text)
# Convert bold and italic text markdown_text = re.sub(r'\*\*\*(.*?)\*\*\*', r'*\1*', markdown_text) markdown_text = re.sub(r'\*\*(.*?)\*\*', r'*\1*', markdown_text) markdown_text = re.sub(r'\*(.*?)\*', r'_\1_', markdown_text) # Convert links markdown_text = re.sub(r'\[(.*?)\]\((.*?)\)', r'<\2|\1>', markdown_text) # Convert inline code markdown_text = re.sub(r'`(.*?)`', r'`\1`', markdown_text) # Convert code blocks markdown_text = re.sub(r'```(.*?)```', r'```\1```', markdown_text, flags=re.DOTALL) return markdown_text
markdown_text = """
Bold text
Italic text
Bold and Italic text
Link
Inline code
The text was updated successfully, but these errors were encountered:
No branches or pull requests
as a example (from chat GPT)
import re
def convert_markdown_to_mrkdwn(markdown_text):
# Convert headers
markdown_text = re.sub(r'(^|\n)### (.)', r'\1 \2*\n', markdown_text)
markdown_text = re.sub(r'(^|\n)## (.)', r'\1** \2**\n', markdown_text)
markdown_text = re.sub(r'(^|\n)# (.)', r'\1*** \2***\n', markdown_text)
Example usage
markdown_text = """
Header 1
Header 2
Header 3
Bold text
Italic text
Bold and Italic text
Link
Inline code
The text was updated successfully, but these errors were encountered: