Skip to content

Commit

Permalink
🐛 Fix filename
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Mar 24, 2024
1 parent fced3a6 commit 8f6a3f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public static String fixFileName(String name, String source, Tools5eIndexType ty
|| type == Tools5eIndexType.tableGroup) {
return Tui.slugify(name); // file name is based on chapter, etc.
}
name = Tui.slugify(name.replaceAll(" \\(\\*\\)", "-gv"));
return name + sourceIfNotDefault(source, type);
return Tui.slugify(name.replaceAll(" \\(\\*\\)", "-gv")
+ sourceIfNotDefault(source, type));
}

private static String sourceIfNotDefault(String source, Tools5eIndexType type) {
Expand Down
8 changes: 6 additions & 2 deletions src/test/java/dev/ebullient/convert/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ public static void checkMarkdownLink(String baseDir, Path p, String line, List<S
if (path.startsWith("http") && path.contains(" ")) {
e.add(String.format("HTTP path with space in %s: %s ", p, m.group(0)));
return;
} else if (path.startsWith("http") || path.contains("vaultPath") || path.contains("#anchor")
|| path.startsWith("{it.") || path.startsWith("{resource.")) {
} else if (path.startsWith("http")
|| path.startsWith("file://")
|| path.contains("vaultPath")
|| path.contains("#anchor")
|| path.startsWith("{it.")
|| path.startsWith("{resource.")) {
// template examples, or other non-file links
return;
}
Expand Down

0 comments on commit 8f6a3f3

Please sign in to comment.