UNPKG

remarked

Version:

Markdown parser and lexer. A fork of marked.js maintained for Assemble.

70 lines (56 loc) 2.02 kB
/** * remarked <https://github.com/jonschlinkert/remarked> * * Copyright (c) 2014 Jon Schlinkert, contributors. * Licensed under the MIT license. */ 'use strict'; var expect = require('chai').expect; var remarked = require('../'); var helper = require('./helpers/utils'); var normalize = helper.stripSpaces; /** * Language tests */ describe('code', function () { describe('code_blocks', function () { it('should convert code_blocks', function () { var testfile = 'code_blocks'; var fixture = helper.readFile(testfile + '.md'); var actual = remarked(fixture); helper.writeActual(testfile, actual); var expected = helper.readFile(testfile + '.html'); expect(normalize(actual)).to.equal(normalize(expected)); }); }); describe('code_spans', function () { it('should convert code_spans', function () { var testfile = 'code_spans'; var fixture = helper.readFile(testfile + '.md'); var actual = remarked(fixture); helper.writeActual(testfile, actual); var expected = helper.readFile(testfile + '.html'); expect(normalize(actual)).to.equal(normalize(expected)); }); }); describe('nested_code', function () { it('should convert nested_code', function () { var testfile = 'nested_code'; var fixture = helper.readFile(testfile + '.md'); var actual = remarked(fixture); helper.writeActual(testfile, actual); var expected = helper.readFile(testfile + '.html'); expect(normalize(actual)).to.equal(normalize(expected)); }); }); describe('when code is indented by tabs', function () { it('should correctly determine tabs and convert to html', function () { var testfile = 'tabs'; var fixture = helper.readFile(testfile + '.md'); var actual = remarked(fixture); helper.writeActual(testfile, actual); var expected = helper.readFile(testfile + '.html'); expect(normalize(actual)).to.equal(normalize(expected)); }); }); });