   runEditorTests = (grammar, fixture, scope, opts = {}) ->
     opts.addGrammar ?= true
     opts.selectBeforeTest ?= false
+    opts.crlf ?= '\n'
 
-    describe "editor tests for #{grammar}", ->
+    describe "editor tests for #{grammar} with #{JSON.stringify(opts.crlf)}", ->
       editor = null
 
-      test = testFormat editorFormat = (input) ->
+      editorFormat = (input) ->
         editor.setText input
         if opts.selectBeforeTest
           editor.setSelectedBufferRange(editor.getBuffer().getRange())
         atom.commands.dispatch atom.views.getView(editor), 'markdown-table-formatter:format'
         editor.getText()
+
+      modCrLf = (x) -> x.replace(/\n/g, opts.crlf)
+
+      test = testFormat editorFormat, modCrLf
 
       beforeEach ->
         grammarPromise = atom.packages.activatePackage(grammar)

        expected = ''
        for table in testTables
          text = nonTables[Math.floor(Math.random() * nonTables.length)]
          edtext += '\n' + text + '\n' + table.test
          expected += '\n' + text + '\n' + table.expected
        test edtext, expected

  runEditorTests 'language-gfm', 'empty.md', 'source.gfm'
  runEditorTests 'language-text', 'empty.text', 'text.plain.null-grammar'
  runEditorTests 'language-text', 'empty.text', 'text.plain.null-grammar',
    addGrammar: false
    selectBeforeTest: true


      describe 'Tables at the end of document', ->
        modTest = testFormat editorFormat, (text, rand) ->
          modCrLf nonTables[Math.floor(rand * nonTables.length)] + opts.crlf + text
        testSuite modTest

      describe 'Tables at the beginning of document', ->
        modTest = testFormat editorFormat, (text, rand) ->
          modCrLf text + opts.crlf + nonTables[Math.floor(rand * nonTables.length)]
        testSuite modTest

      it 'should properly format large text', ->
