     italic = MarkdownItalic(font: font)
     code = MarkdownCode(font: font)
 
-    self.automaticLinkDetectionEnabled = automaticLinkDetectionEnabled
     self.escapingElements = [codeEscaping, escaping]
-    self.defaultElements = [header, list, quote, link, automaticLink, bold, italic]
     self.unescapingElements = [code, unescaping]
     self.customElements = customElements
+    self.enabledElements = enabledElements
+    updateDefaultElements()
   }
 
   // MARK: Element Extensibility

    elements.append(contentsOf: customElements)
    elements.append(contentsOf: unescapingElements)
    elements.forEach { element in
      if automaticLinkDetectionEnabled || type(of: element) != MarkdownAutomaticLink.self {
        element.parse(attributedString)
      }
    }
    return attributedString
  }

}

import UIKit

open class MarkdownParser {
  public struct EnabledElements: OptionSet {
    public let rawValue: Int

    public init(rawValue: Int) {
      self.rawValue = rawValue
    }

    public static let automaticLink = EnabledElements(rawValue: 1)
    public static let header        = EnabledElements(rawValue: 1 << 1)
    public static let list          = EnabledElements(rawValue: 1 << 2)
    public static let quote         = EnabledElements(rawValue: 1 << 3)
    public static let link          = EnabledElements(rawValue: 1 << 4)
    public static let bold          = EnabledElements(rawValue: 1 << 5)
    public static let italic        = EnabledElements(rawValue: 1 << 6)
    public static let code          = EnabledElements(rawValue: 1 << 7)

    public static let disabledAutomaticLink: EnabledElements = [
      .header,
      .list,
      .quote,
      .link,
      .bold,
      .italic,
      .code,
      ]

    public static let all: EnabledElements = [
      .disabledAutomaticLink,
      .automaticLink,
      ]
  }


  // MARK: Element Arrays
  fileprivate var escapingElements: [MarkdownElement]
  fileprivate var defaultElements: [MarkdownElement] = []
  fileprivate var unescapingElements: [MarkdownElement]

  open var customElements: [MarkdownElement]
