anchor.diff:      | Lines.TrimBlankStart [] -> () 
       | _ -> failwithf "Unexpectedly stopped!\n%A" lines }
   
  +
  +
  +open FountainTestParser
  +
  +/// Representation of a Fountain document - the representation of Paragraphs
  +/// uses an F# discriminated union type and so is best used from F#.
  +type FountainDocument(paragraphs) =
  +  /// Returns a list of paragraphs in the document
  +  member x.Paragraphs : FountainParagraphs = paragraphs
  +  /// Returns a dictionary containing explicitly defined links
  +
  +
  +/// Static class that provides methods for formatting 
  +/// and transforming Markdown documents.
  +type Fountain =
  +  /// Parse the specified text into a MarkdownDocument. Line breaks in the
  +  /// inline HTML (etc.) will be stored using the specified string.
  +  static member Parse(text, newline) =
  +    use reader = new StringReader(text)
  +    let lines = 
  +      [ let line = ref ""
  +        while (line := reader.ReadLine(); line.Value <> null) do
  +          yield line.Value ]
  +    let (Lines.TrimBlank lines) = lines
  +    let ctx : ParsingContext = { Newline = newline }
  +    let paragraphs = lines |> parseParagraphs ctx |> List.ofSeq
  +    FountainDocument(paragraphs)
  +
  +  /// Parse the specified text into a MarkdownDocument.
  +  static member Parse(text) =
  +    Parse(text, Environment.NewLine)
  +
  +
   //======= TESTING CODE
   open FountainTestParser
   
  
positive.code: let string4 = "_some underlined text_"
  let string5 = "some text that's not emphasized"
  let string6 = "pretty sure this will fail *some italic text **with some bold** in the middle*"
  
  let testString string = 
    match string with
  
negative.code:     | Paragraph of FountainSpans
      | Span of FountainSpans
  
    /// A type alias for a list of paragraphs
    and FountainParagraphs = list<FountainParagraph>
  
    //====== Parser
    // Part 1: Inline Formatting
  