diff --git a/scripts/gopher/convert_to_gopher.py b/scripts/gopher/convert_to_gopher.py index d11d2d9..7cd2b5a 100644 --- a/scripts/gopher/convert_to_gopher.py +++ b/scripts/gopher/convert_to_gopher.py @@ -10,10 +10,14 @@ Usage: import argparse import re +import sys import textwrap import yaml from pathlib import Path +# Add script directory to path for imports +sys.path.insert(0, str(Path(__file__).parent)) + from ascii_art import ( LINE_WIDTH, POST_HEADER, @@ -100,10 +104,8 @@ def convert_formatting(text: str) -> str: # Bold: **text** -> *text* text = re.sub(r"\*\*([^*]+)\*\*", r"*\1*", text) - # Italic: *text* or _text_ -> _text_ - # Be careful not to match our converted bold + # Italic: *text* -> _text_ (but not our converted bold *text*) text = re.sub(r"(? str: """Wrap text to LINE_WIDTH, preserving code blocks and structure.""" lines = text.split("\n") result = [] - in_code_block = False paragraph = [] def flush_paragraph(): diff --git a/scripts/gopher/generate_gophermaps.py b/scripts/gopher/generate_gophermaps.py index d27e578..bfec757 100644 --- a/scripts/gopher/generate_gophermaps.py +++ b/scripts/gopher/generate_gophermaps.py @@ -9,9 +9,13 @@ Usage: import argparse import re +import sys import yaml from pathlib import Path +# Add script directory to path for imports +sys.path.insert(0, str(Path(__file__).parent)) + from ascii_art import ( HEADER_BLOG_INDEX, DIR_TO_HEADER,