Skip to content

Commit 72a242f

Browse files
Fixed bug where the info command would not work due to parantheses not being escaped
1 parent 1fccb08 commit 72a242f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

NotifierBot/Sources/Notifier/Commands/InfoCommand.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ struct InfoCommand: Command {
3939
private func infoText(for e: URLEntry) -> String {
4040
var lines = ["*\(e.name.escaped()):*"]
4141
// Escape '-' with backslash
42-
lines.append("\\- URL: \(e.url.escaped())")
42+
lines.append("- URL: \(e.url)".escaped())
4343
if e.area.height != 0 && e.area.width != 0 {
44-
lines.append("\\- Area: (\(e.area.x), \(e.area.y), \(e.area.width), \(e.area.height))")
44+
lines.append("- Area: (\(e.area.x), \(e.area.y), \(e.area.width), \(e.area.height))".escaped())
4545
}
4646
if e.delay > 0 {
47-
lines.append("\\- Delay: \(e.delay)")
47+
lines.append("- Delay: \(e.delay)".escaped())
4848
}
4949
if !e.captureElement.isEmpty {
50-
lines.append("\\- Capture Element: `\(e.captureElement.escaped())`")
50+
lines.append("- Capture Element: ".escaped() + "`\(e.captureElement.escaped())`")
5151
}
5252
if !e.clickElement.isEmpty {
53-
lines.append("\\- Click Element: `\(e.clickElement.escaped())`")
53+
lines.append("- Click Element: ".escaped() + "`\(e.clickElement.escaped())`")
5454
}
5555
if !e.waitElement.isEmpty {
56-
lines.append("\\- Wait Element: `\(e.waitElement.escaped())`")
56+
lines.append("- Wait Element: ".escaped() + "`\(e.waitElement.escaped())`")
5757
}
5858
return lines.joined(separator: "\n")
5959
}

0 commit comments

Comments
 (0)