mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Merge pull request #525 from aidantwoods/fix/infostring
Properly support fenced code block infostring
This commit is contained in:
commit
e941dcc3f0
@ -420,7 +420,7 @@ class Parsedown
|
|||||||
|
|
||||||
protected function blockFencedCode($Line)
|
protected function blockFencedCode($Line)
|
||||||
{
|
{
|
||||||
if (preg_match('/^['.$Line['text'][0].']{3,}[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
|
if (preg_match('/^['.$Line['text'][0].']{3,}[ ]*([^`]+)?[ ]*$/', $Line['text'], $matches))
|
||||||
{
|
{
|
||||||
$Element = array(
|
$Element = array(
|
||||||
'name' => 'code',
|
'name' => 'code',
|
||||||
|
@ -4,3 +4,4 @@ $message = 'fenced code block';
|
|||||||
echo $message;</code></pre>
|
echo $message;</code></pre>
|
||||||
<pre><code>tilde</code></pre>
|
<pre><code>tilde</code></pre>
|
||||||
<pre><code class="language-php">echo 'language identifier';</code></pre>
|
<pre><code class="language-php">echo 'language identifier';</code></pre>
|
||||||
|
<pre><code class="language-c#">echo 'language identifier with non words';</code></pre>
|
@ -12,3 +12,7 @@ tilde
|
|||||||
```php
|
```php
|
||||||
echo 'language identifier';
|
echo 'language identifier';
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```c#
|
||||||
|
echo 'language identifier with non words';
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user