Skip to content

Commit 0bc2fc5

Browse files
authored
Merge pull request #1265 from remyrylan/master
CommonMark code block class names
2 parents 0218945 + 7b1d0be commit 0bc2fc5

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

docs/USING_ADVANCED.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ console.log(myMarked('I am using __markdown__.'));
4747
|headerIds |`boolean` |`true` |v0.4.0 |If true, include an `id` attribute when emitting headings (h1, h2, h3, etc).|
4848
|headerPrefix|`string` |`''` |??? |A string to prefix the `id` attribute when emitting headings (h1, h2, h3, etc).|
4949
|highlight |`function`|`null` |??? |A function to highlight code blocks, see <a href="#highlight">Asynchronous highlighting</a>.|
50-
|langPrefix |`string` |`'lang-'`|??? |A string to prefix the className in a `<code>` block. Useful for syntax highlighting.|
50+
|langPrefix |`string` |`'language-'`|??? |A string to prefix the className in a `<code>` block. Useful for syntax highlighting.|
5151
|mangle |`boolean` |`true` |??? |??? |
5252
|pedantic |`boolean` |`false` |??? |If true, conform to the original `markdown.pl` as much as possible. Don't fix original markdown bugs or behavior. Turns off and overrides `gfm`.|
5353
|renderer |`object` |`new Renderer()`|???|An object containing functions to render tokens to HTML. See [extensibility](USING_PRO.md) for more details.|

lib/marked.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ marked.getDefaults = function () {
14701470
headerIds: true,
14711471
headerPrefix: '',
14721472
highlight: null,
1473-
langPrefix: 'lang-',
1473+
langPrefix: 'language-',
14741474
mangle: true,
14751475
pedantic: false,
14761476
renderer: new Renderer(),

test/new/gfm_code.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
<pre><code class="lang-js">var a = &#39;hello&#39;;
1+
<pre><code class="language-js">var a = &#39;hello&#39;;
22
console.log(a + &#39; world&#39;);</code></pre>
3-
<pre><code class="lang-bash">echo &quot;hello, ${WORLD}&quot;</code></pre>
4-
<pre><code class="lang-longfence">Q: What do you call a tall person who sells stolen goods?</code></pre>
5-
<pre><code class="lang-ManyTildes">A longfence!</code></pre>
3+
<pre><code class="language-bash">echo &quot;hello, ${WORLD}&quot;</code></pre>
4+
<pre><code class="language-longfence">Q: What do you call a tall person who sells stolen goods?</code></pre>
5+
<pre><code class="language-ManyTildes">A longfence!</code></pre>
66
<p>How about an empty code block?</p>
7-
<pre><code class="lang-js"></code></pre>
7+
<pre><code class="language-js"></code></pre>
88
<p>How about a code block with only an empty line?</p>
9-
<pre><code class="lang-js">
9+
<pre><code class="language-js">
1010
</code></pre>
1111

1212
<p>With some trailing empty lines:</p>
1313
<pre><code>ciao
1414

1515

16-
</code></pre>
16+
</code></pre>

test/new/gfm_code_hr_list.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ <h2 id="foo">foo</h2>
2222
<li><p>foo:</p>
2323
<ol>
2424
<li><p>foo <code>bar</code> bar:</p>
25-
<pre><code class="lang-erb"> some code here
25+
<pre><code class="language-erb"> some code here
2626
</code></pre>
2727
</li>
2828
<li><p>foo <code>bar</code> bar:</p>
29-
<pre><code class="lang-erb"> foo
29+
<pre><code class="language-erb"> foo
3030
---
3131
bar
3232
---
3333
foo
3434
bar</code></pre>
3535
</li>
3636
<li><p>foo <code>bar</code> bar:</p>
37-
<pre><code class="lang-html"> ---
37+
<pre><code class="language-html"> ---
3838
foo
3939
foo
4040
---

test/specs/commonmark/commonmark-spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('CommonMark 0.28 Fenced code blocks', function() {
155155
var section = 'Fenced code blocks';
156156

157157
// var shouldPassButFails = [];
158-
var shouldPassButFails = [93, 95, 96, 97, 101, 102, 106, 108, 111, 112, 113];
158+
var shouldPassButFails = [93, 95, 96, 97, 101, 102, 106, 108, 112];
159159

160160
var willNotBeAttemptedByCoreTeam = [];
161161

0 commit comments

Comments
 (0)