markdown-analysis 0.1.0__tar.gz → 0.1.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/PKG-INFO +1 -1
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/PKG-INFO +1 -1
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/mrkdwn_analysis/markdown_analyzer.py +24 -9
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/setup.py +1 -1
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/LICENSE +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/README.md +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/SOURCES.txt +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/dependency_links.txt +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/requires.txt +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/top_level.txt +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/mrkdwn_analysis/__init__.py +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/setup.cfg +0 -0
- {markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/test/__init__.py +0 -0
@@ -233,6 +233,7 @@ class MarkdownParser:
|
|
233
233
|
separator_line = self.lines[self.pos+1].strip()
|
234
234
|
self.pos += 2
|
235
235
|
rows = []
|
236
|
+
|
236
237
|
while self.pos < self.length:
|
237
238
|
line = self.lines[self.pos].strip()
|
238
239
|
if not line or self.starts_new_block(line):
|
@@ -240,12 +241,21 @@ class MarkdownParser:
|
|
240
241
|
rows.append(line)
|
241
242
|
self.pos += 1
|
242
243
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
244
|
+
def parse_row(row):
|
245
|
+
parts = row.strip().split('|')
|
246
|
+
if parts and not parts[0]:
|
247
|
+
parts.pop(0)
|
248
|
+
if parts and not parts[-1]:
|
249
|
+
parts.pop()
|
250
|
+
return [p.strip() for p in parts]
|
247
251
|
|
248
|
-
|
252
|
+
header_cells = parse_row(header_line)
|
253
|
+
data_rows = [parse_row(row) for row in rows]
|
254
|
+
|
255
|
+
self.tokens.append(BlockToken('table', meta={
|
256
|
+
"header": header_cells,
|
257
|
+
"rows": data_rows
|
258
|
+
}, line=start+1))
|
249
259
|
|
250
260
|
def starts_new_block(self, line):
|
251
261
|
return (self.ATX_HEADER_RE.match(line) or
|
@@ -274,19 +284,24 @@ class MarkdownParser:
|
|
274
284
|
self.pos = self.length
|
275
285
|
|
276
286
|
def parse_fenced_code_block(self, lang):
|
287
|
+
initial_line = self.pos
|
288
|
+
initial_indent = len(self.lines[self.pos]) - len(self.lines[self.pos].lstrip())
|
289
|
+
fence_marker = self.lines[self.pos].strip()[:3] # Get ``` or ~~~
|
277
290
|
self.pos += 1
|
278
291
|
start = self.pos
|
292
|
+
|
279
293
|
while self.pos < self.length:
|
280
294
|
line = self.lines[self.pos]
|
281
|
-
if line.strip()
|
295
|
+
if line.strip() == fence_marker:
|
282
296
|
content = "\n".join(self.lines[start:self.pos])
|
283
297
|
self.tokens.append(BlockToken('code', content=content, meta={"language": lang}, line=start+1))
|
284
298
|
self.pos += 1
|
285
299
|
return
|
286
300
|
self.pos += 1
|
287
|
-
|
288
|
-
|
289
|
-
self.pos =
|
301
|
+
|
302
|
+
# If we reach here, we didn't find the closing fence
|
303
|
+
self.pos = initial_line # Reset position if fence not found
|
304
|
+
raise ValueError(f"Unclosed code fence starting at line {initial_line + 1}")
|
290
305
|
|
291
306
|
def parse_blockquote(self):
|
292
307
|
start = self.pos
|
File without changes
|
File without changes
|
File without changes
|
{markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
{markdown_analysis-0.1.0 → markdown_analysis-0.1.2}/markdown_analysis.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|