Skip to content

Commit c7cf491

Browse files
committed
fix: domain is now optional
1 parent aa00e58 commit c7cf491

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ from md2bbcode.main import process_readme
3535
# Your Markdown content
3636
markdown_text = "# Hell World"
3737

38+
# Optional domain to prepend to relative URLs
39+
domain = 'https://raw.githubusercontent.com/yourusername/yourrepo/main/'
40+
3841
# Convert Markdown to BBCode
39-
bbcode_output = process_readme(markdown_text)
42+
bbcode_output = process_readme(markdown_text, domain=domain)
4043

4144
# Output the BBCode
4245
print(bbcode_output)

src/md2bbcode/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def convert_markdown_to_bbcode(markdown_text, domain):
2727
# Convert Markdown text to BBCode
2828
return markdown_parser(markdown_text)
2929

30-
def process_readme(markdown_text, domain, debug=False):
30+
def process_readme(markdown_text, domain=None, debug=False):
3131
# Convert Markdown to BBCode
3232
bbcode_text = convert_markdown_to_bbcode(markdown_text, domain)
3333

0 commit comments

Comments
 (0)