import re from src.format_extractor import FormatExtractor # 模拟带换行的 HTML html_with_newlines = """ in the name of abundance... """ extractor = FormatExtractor() clean_text, text_with_ph, _, _, _ = extractor.extract(f"

{html_with_newlines}

") print(f"Original HTML: {repr(html_with_newlines)}") print(f"Clean Text: {repr(clean_text)}") print(f"Text with PH: {repr(text_with_ph)}") print(f"Has Newline: {'\\n' in text_with_ph}") print("-" * 20) # 模拟 Prompt 构建 prompt_line = f"p_00006 [BODY] {text_with_ph}" print("Prompt Line Preview:") print(prompt_line)