Skip to content

Commit

Permalink
Fix of #3
Browse files Browse the repository at this point in the history
  • Loading branch information
edudnyk committed Oct 2, 2021
1 parent 5464b5e commit 904cb55
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Sources/DocCArchive/Schema_0_1/Content/CodeListing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
extension DocCArchive.DocCSchema_0_1.Content {

public struct CodeListing: Equatable, CustomStringConvertible, Codable {
public var syntax : String
public var syntax : String?
public var code : [ String ]

public var description: String {
return syntax.isEmpty ? "<Code #\(code.count)>"
: "<Code[\(syntax)]: #\(code.count)>"
guard let syntax = syntax, !syntax.isEmpty else {
return "<Code #\(code.count)>"
}
return "<Code[\(syntax)]: #\(code.count)>"
}
}
}

0 comments on commit 904cb55

Please sign in to comment.