arxiv-to-prompt 0.4.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {arxiv_to_prompt-0.4.0/src/arxiv_to_prompt.egg-info → arxiv_to_prompt-0.4.1}/PKG-INFO +1 -1
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/pyproject.toml +1 -1
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt/core.py +2 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1/src/arxiv_to_prompt.egg-info}/PKG-INFO +1 -1
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/tests/test_core.py +19 -1
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/LICENSE +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/README.md +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/setup.cfg +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt/__init__.py +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt/cli.py +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/SOURCES.txt +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/dependency_links.txt +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/entry_points.txt +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/requires.txt +0 -0
- {arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/top_level.txt +0 -0
|
@@ -131,6 +131,8 @@ def find_main_tex(directory: str) -> Optional[str]:
|
|
|
131
131
|
|
|
132
132
|
def remove_comments_from_lines(text: str) -> str:
|
|
133
133
|
"""Remove LaTeX comments while preserving newlines."""
|
|
134
|
+
# Remove \iffalse...\fi blocks (commonly used to comment out large sections)
|
|
135
|
+
text = re.sub(r'\\iffalse\b.*?\\fi\b', '', text, flags=re.DOTALL)
|
|
134
136
|
lines = text.split('\n')
|
|
135
137
|
result = []
|
|
136
138
|
for line in lines:
|
|
@@ -109,11 +109,29 @@ def test_remove_comments_from_lines():
|
|
|
109
109
|
("Multiple % comments % here", "Multiple"),
|
|
110
110
|
("Line with both \\% and % real comment", "Line with both \\% and"),
|
|
111
111
|
]
|
|
112
|
-
|
|
112
|
+
|
|
113
113
|
for input_text, expected in test_cases:
|
|
114
114
|
assert remove_comments_from_lines(input_text).rstrip() == expected
|
|
115
115
|
|
|
116
116
|
|
|
117
|
+
def test_remove_iffalse_blocks():
|
|
118
|
+
"""Test removal of \\iffalse...\\fi blocks."""
|
|
119
|
+
# Single line
|
|
120
|
+
assert remove_comments_from_lines("before \\iffalse hidden \\fi after") == "before after"
|
|
121
|
+
|
|
122
|
+
# Multi-line block
|
|
123
|
+
input_text = "before\n\\iffalse\nhidden\ncontent\n\\fi\nafter"
|
|
124
|
+
result = remove_comments_from_lines(input_text)
|
|
125
|
+
assert "hidden" not in result
|
|
126
|
+
assert "before" in result
|
|
127
|
+
assert "after" in result
|
|
128
|
+
|
|
129
|
+
# Multiple blocks
|
|
130
|
+
input_text = "a \\iffalse x \\fi b \\iffalse y \\fi c"
|
|
131
|
+
result = remove_comments_from_lines(input_text)
|
|
132
|
+
assert result == "a b c"
|
|
133
|
+
|
|
134
|
+
|
|
117
135
|
def test_find_main_tex(temp_cache_dir):
|
|
118
136
|
"""Test finding the main tex file."""
|
|
119
137
|
# Create test files
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{arxiv_to_prompt-0.4.0 → arxiv_to_prompt-0.4.1}/src/arxiv_to_prompt.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|