Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/enforce ascii #74

Merged
merged 4 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mdlinker"
version = "1.5.0"
version = "1.5.2"
edition = "2021"

[profile.dev]
Expand Down
10 changes: 2 additions & 8 deletions bin/enforce-ascii
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,12 @@ def main():
custom_map = parse_custom_replacements(args.replacements)
char_map.update(custom_map)

# Process each file passed through stdin (xargs-compatible)
if not sys.stdin.isatty(): # If stdin is not empty
files = [line.strip() for line in sys.stdin]
else:
files = args.files

if not files:
if not args.files:
print("No files specified or provided via stdin.", file=sys.stderr)
return

found = False
for file_path in files:
for file_path in args.files:
non_ascii_chars = process_file(file_path, char_map if args.fix else None)
if non_ascii_chars:
print(f"Non-ASCII characters found in {file_path}: {''.join(non_ascii_chars)}")
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Config {
};

// CLI has priority over file by being last
combine_partials(&[&file, &cli]).map_err(derive_more::Into::into)
combine_partials(&[&file, &cli])
}

/// Legacy directories function
Expand Down
Loading