mdformat-space-control 0.4.2__tar.gz → 0.4.4__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.
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/PKG-INFO +1 -1
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/mdformat_space_control/__init__.py +1 -1
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/mdformat_space_control/plugin.py +9 -1
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/.editorconfig +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/.gitignore +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/CLAUDE.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/LICENSE +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/README.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/CLAUDE.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/contributing.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/default-formatting-style.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/installation-and-usage.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/overview.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/plugins.md +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/mdformat_space_control/config.py +0 -0
- {mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mdformat_space_control
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: An mdformat plugin for space control: EditorConfig indentation, tight lists, frontmatter spacing, smart dash conversion, explicit line breaks, and wikilinks.
|
|
5
5
|
Project-URL: Homepage, https://github.com/jdmonaco/mdformat-space-control
|
|
6
6
|
Author-email: Joseph Monaco <joe@selfmotion.net>
|
{mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/mdformat_space_control/plugin.py
RENAMED
|
@@ -411,8 +411,13 @@ def _convert_dash_sequences(text: str) -> str:
|
|
|
411
411
|
em_dash_re = re.compile(r"(?<!-)---(?!-)")
|
|
412
412
|
en_dash_re = re.compile(r"(?<!-)--(?!-)")
|
|
413
413
|
|
|
414
|
+
# CLI option pattern: --word or ---word preceded by whitespace or line start
|
|
415
|
+
cli_option_re = re.compile(r"(?<=\s)-{2,3}(?=\w)")
|
|
416
|
+
|
|
414
417
|
# Lines that are only dashes (thematic breaks, frontmatter delimiters)
|
|
418
|
+
# or separator lines starting/ending with dashes (e.g., "--- Title ---")
|
|
415
419
|
only_dashes_re = re.compile(r"^-{2,}\s*$")
|
|
420
|
+
separator_line_re = re.compile(r"^-{2,3}\s+.*\s+-{2,3}\s*$")
|
|
416
421
|
|
|
417
422
|
lines = text.split("\n")
|
|
418
423
|
result = []
|
|
@@ -431,7 +436,7 @@ def _convert_dash_sequences(text: str) -> str:
|
|
|
431
436
|
if "-->" in line:
|
|
432
437
|
in_html_comment = False
|
|
433
438
|
result.append(line)
|
|
434
|
-
elif only_dashes_re.match(line):
|
|
439
|
+
elif only_dashes_re.match(line) or separator_line_re.match(stripped):
|
|
435
440
|
result.append(line)
|
|
436
441
|
else:
|
|
437
442
|
# Check for multi-line HTML comment opening (no closing on same line)
|
|
@@ -453,6 +458,9 @@ def _convert_dash_sequences(text: str) -> str:
|
|
|
453
458
|
protected = html_comment_re.sub(_save_placeholder, protected)
|
|
454
459
|
protected = html_tag_re.sub(_save_placeholder, protected)
|
|
455
460
|
|
|
461
|
+
# Protect CLI option dashes (e.g., --output, ---long-opt)
|
|
462
|
+
protected = cli_option_re.sub(_save_placeholder, protected)
|
|
463
|
+
|
|
456
464
|
# Convert em-dash first (longer match), then en-dash
|
|
457
465
|
protected = em_dash_re.sub("\u2014", protected)
|
|
458
466
|
protected = en_dash_re.sub("\u2013", protected)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/dev/default-formatting-style.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mdformat_space_control-0.4.2 → mdformat_space_control-0.4.4}/mdformat_space_control/config.py
RENAMED
|
File without changes
|
|
File without changes
|