                 // What kind of line is it?
                 if let (linePrefix, lineSuffix) = line.lineComponents() {
                     if FileTags.Background.contains(linePrefix) {
-                        state = ParseState(description: lineSuffix.trimmingColon, parsingBackground: true)
-                    } else if FileTags.Scenario.contains(linePrefix) {
-                        saveBackgroundOrScenarioAndUpdateParseState(lineSuffix.trimmingColon)
+                        state = ParseState(description: lineSuffix, parsingBackground: true)
+                    } else if FileTags.Scenario.contains(linePrefix)
+                        || FileTags.ScenarioOutline.contains(linePrefix) {
+                        saveBackgroundOrScenarioAndUpdateParseState(lineSuffix)
                     } else if FileTags.Given.contains(linePrefix)
                         || FileTags.When.contains(linePrefix)
                         || FileTags.Then.contains(linePrefix)
                         || FileTags.And.contains(linePrefix) {
                         state.steps.append(lineSuffix)
-                    } else if FileTags.ScenarioOutline.contains(linePrefix) {
-                        saveBackgroundOrScenarioAndUpdateParseState(lineSuffix.trimmingColon)
                     } else if FileTags.Examples.contains(linePrefix) {
                         // Prep the examples array for examples
                         state.exampleLines = []


extension String {

    var trimmingColon: String {
        return self.trimmingCharacters(in: CharacterSet(charactersIn: ":").union(.whitespaces))
    }

    func componentsWithPrefix(_ prefixVariants: [String]) -> (String, String?) {
        for prefixVariant in prefixVariants {
            let (prefix, suffix) = componentsWithPrefix(prefixVariant)

    static var Feature: [String] { return localized(expression: "feature", default: "Feature:") }
    static var Background: [String] { return localized(expression: "background", default: "Background:") }
    static var Scenario: [String] { return localized(expression: "scenario", default: "Scenario:") }
    static var ScenarioOutline: [String] { return localized(expression: "scenarioOutline", default: "Scenario Outline:") }
    static var Examples: [String] { return localized(expression: "examples", default: "Examples:") }
    static let ExampleLine: [String] = ["|"]
    static var Given: [String] { return localized(expression: "given", default: "Given ") }
