We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2123075 commit 292ea8bCopy full SHA for 292ea8b
Sources/MarkdownSemantics/Markdown.BlockInterpreter.swift
@@ -68,8 +68,18 @@ extension Markdown.BlockInterpreter
68
// legitimized anywhere else.
69
guard
70
let i:String.Index = value.firstIndex(of: "/"),
71
- let j:String.Index = value.lastIndex(of: "/"),
72
- case "/Snippets" = value[i ..< j]
+ let j:String.Index = value.lastIndex(of: "/")
+ else
73
+ {
74
+ // TODO: emit diagnostic.
75
+ continue
76
+ }
77
+
78
+ // OK for the path to contain additional intermediate path components, which
79
+ // are just as irrelevant as the package name, because snippet names are
80
+ // unique within a package.
81
+ guard
82
+ case "Snippets" = value[value.index(after: i)...].prefix(while: { $0 != "/" })
83
else
84
{
85
// TODO: emit diagnostic.
0 commit comments