Skip to content

Commit

Permalink
Make markdown-tool changes backwards compatible as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Samasaur1 committed Oct 10, 2024
1 parent 1db1755 commit da3b39c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/markdown-tool/Commands/FormatCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extension MarkdownCommand {
var emphasisMarker: String = "*"

@Option(help: "Strong emphasis marker; choices: \(MarkupFormatter.Options.EmphasisMarker.allCases.map { $0.rawValue }.joined(separator: ", "))")
var strongEmphasisMarker: String = "*"
var strongEmphasisMarker: String?

@Flag(inversion: .prefixedNo, exclusivity: .chooseLast, help: "Condense links whose text matches their destination to 'autolinks' e.g. <https://swift.org>")
var condenseAutolinks: Bool = true
Expand Down Expand Up @@ -209,7 +209,7 @@ extension MarkdownCommand {
throw ArgumentParser.ValidationError("The value '\(self.emphasisMarker)' is invalid for '--emphasis-marker'")
}

guard let strongEmphasisMarker = MarkupFormatter.Options.EmphasisMarker(argument: strongEmphasisMarker) else {
guard let strongEmphasisMarker = MarkupFormatter.Options.EmphasisMarker(argument: strongEmphasisMarker ?? self.emphasisMarker) else {
throw ArgumentParser.ValidationError("The value '\(self.strongEmphasisMarker)' is invalid for '--strong-emphasis-marker'")
}

Expand Down

0 comments on commit da3b39c

Please sign in to comment.