Skip to content

Commit

Permalink
use only the first word of the inforstring as the languauge in code b…
Browse files Browse the repository at this point in the history
…locks (pass cm example 112)
  • Loading branch information
Feder1co5oave committed Dec 8, 2018
1 parent f0cf2c8 commit d87c502
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/marked.js
Expand Up @@ -920,7 +920,8 @@ function Renderer(options) {
this.options = options || marked.defaults;
}

Renderer.prototype.code = function(code, lang, escaped) {
Renderer.prototype.code = function(code, infostring, escaped) {
var lang = (infostring || '').match(/\S*/)[0];
if (this.options.highlight) {
var out = this.options.highlight(code, lang);
if (out != null && out !== code) {
Expand Down
3 changes: 1 addition & 2 deletions test/specs/commonmark/commonmark-spec.js
Expand Up @@ -159,8 +159,7 @@ describe('CommonMark 0.28 Indented code blocks', function() {
describe('CommonMark 0.28 Fenced code blocks', function() {
var section = 'Fenced code blocks';

// var shouldPassButFails = [];
var shouldPassButFails = [112];
var shouldPassButFails = [];

var willNotBeAttemptedByCoreTeam = [];

Expand Down

0 comments on commit d87c502

Please sign in to comment.