Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GFM Enhancements (Backticks) #132

Merged
merged 3 commits into from
Nov 28, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Michelf/Markdown.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
| |
# Fenced code block marker # Fenced code block marker
(?<= ^ | \n ) (?<= ^ | \n )
[ ]{0,'.($indent+3).'}~{3,} [ ]{0,'.($indent+3).'}(?:~{3,}|`{3,})
[ ]* [ ]*
(?: (?:
\.?[-_:a-zA-Z0-9]+ # standalone class name \.?[-_:a-zA-Z0-9]+ # standalone class name
Expand Down Expand Up @@ -1918,7 +1918,7 @@ protected function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
# #
# Check for: Fenced code block marker. # Check for: Fenced code block marker.
# #
else if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~+)}', $tag, $capture)) { else if (preg_match('{^\n?([ ]{0,'.($indent+3).'})(~+|`+)}', $tag, $capture)) {
# Fenced code block marker: find matching end marker. # Fenced code block marker: find matching end marker.
$fence_indent = strlen($capture[1]); # use captured indent in re $fence_indent = strlen($capture[1]); # use captured indent in re
$fence_re = $capture[2]; # use captured fence in re $fence_re = $capture[2]; # use captured fence in re
Expand Down Expand Up @@ -2767,7 +2767,7 @@ protected function doFencedCodeBlocks($text) {
(?:\n|\A) (?:\n|\A)
# 1: Opening marker # 1: Opening marker
( (
~{3,} # Marker: three tilde or more. (?:~{3,}|`{3,}) # 3 or more tildes/backticks.
) )
[ ]* [ ]*
(?: (?:
Expand Down