'use strict';
var assert     = require('power-assert');
var MDRenderer = require('../../../../lib/renderer/md');
var renderer = new MDRenderer();

describe('CodeGridMarkdown - Renderer - md', function() {


describe('#code', function() {
  it('言語指定がない場合はmarked標準', function() {
    var html = renderer.render('```\nhoge\n```');
    var expect = '<pre><code>hoge</code></pre>\n';
    assert.equal(html, expect);
  });
  it('言語指定だけある場合もmarked標準', function() {
    var html = renderer.render('```html\nhoge\n```');
    var expect = '<pre><code class="lang-html">hoge</code></pre>\n';
    assert.equal(html, expect);
  });
  it('タイトル指定が雑な場合もmarked標準', function() {
    var html = renderer.render('```html#\nhoge\n```');
    var expect = '<pre><code class="lang-html">hoge</code></pre>\n';
    assert.equal(html, expect);
  });
  it('言語とタイトル指定が正しい場合は拡張したやつ', function() {
    var html1 = renderer.render('```#title\nhoge\n```');
    var expect = '' +
      '<section class="CG2-livecode">\n' +
        '<header class="CG2-livecode__header">\n' +
          '<div class="CG2-livecode__label">title</div>\n' +
        '</header>\n' +
        '<div class="CG2-livecode__body">' +
          '<pre><code>hoge</code></pre>\n' +
        '</div>\n' +
      '</section>\n';
    assert.equal(html1, expect);
  });
  it('言語とタイトル指定が正しい場合は拡張したやつ', function() {
    var html1 = renderer.render('```html#title\nhoge\n```');
    // スペースがあっても気にしない
    var html2 = renderer.render('```html #title\nhoge\n```');
    var expect = '' +
      '<section class="CG2-livecode">\n' +
        '<header class="CG2-livecode__header">\n' +
          '<div class="CG2-livecode__label">title</div>\n' +
        '</header>\n' +
        '<div class="CG2-livecode__body">' +
          '<pre><code class="lang-html">hoge</code></pre>\n' +
        '</div>\n' +
      '</section>\n';
    assert.equal(html1, expect);
    assert.equal(html2, expect);
  });
});


});

@@ -864,483 +864,8 @@
 ) %7B%0A
-    var html1 = renderer.render('%60%60%60#title%5Cnhoge%5Cn%60%60%60');%0A    var expect = '' +%0A      '%3Csection class=%22CG2-livecode%22%3E%5Cn' +%0A        '%3Cheader class=%22CG2-livecode__header%22%3E%5Cn' +%0A          '%3Cdiv class=%22CG2-livecode__label%22%3Etitle%3C/div%3E%5Cn' +%0A        '%3C/header%3E%5Cn' +%0A        '%3Cdiv class=%22CG2-livecode__body%22%3E' +%0A          '%3Cpre%3E%3Ccode%3Ehoge%3C/code%3E%3C/pre%3E%5Cn' +%0A        '%3C/div%3E%5Cn' +%0A      '%3C/section%3E%5Cn';%0A    assert.equal(html1, expect);%0A  %7D);%0A  it('%E8%A8%80%E8%AA%9E%E3%81%A8%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E6%8C%87%E5%AE%9A%E3%81%8C%E6%AD%A3%E3%81%97%E3%81%84%E5%A0%B4%E5%90%88%E3%81%AF%E6%8B%A1%E5%BC%B5%E3%81%97%E3%81%9F%E3%82%84%E3%81%A4', function() %7B%0A
     

Remove local diff