Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.
Open
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
10 changes: 5 additions & 5 deletions markdown/markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ function _doHeaders_callback_setext($matches) {
if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
return $matches[0];

$level = $matches[2]{0} == '=' ? 1 : 2;
$level = $matches[2][0] == '=' ? 1 : 2;
$block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
return "\n" . $this->hashBlock($block) . "\n\n";
}
Expand Down Expand Up @@ -1198,7 +1198,7 @@ function doItalicsAndBold($text) {
} else {
# Other closing marker: close one em or strong and
# change current token state to match the other
$token_stack[0] = str_repeat($token{0}, 3-$token_len);
$token_stack[0] = str_repeat($token[0], 3-$token_len);
$tag = $token_len == 2 ? "strong" : "em";
$span = $text_stack[0];
$span = $this->runSpanGamut($span);
Expand All @@ -1223,7 +1223,7 @@ function doItalicsAndBold($text) {
} else {
# Reached opening three-char emphasis marker. Push on token
# stack; will be handled by the special condition above.
$em = $token{0};
$em = $token[0];
$strong = "$em$em";
array_unshift($token_stack, $token);
array_unshift($text_stack, '');
Expand Down Expand Up @@ -1544,9 +1544,9 @@ function handleSpanToken($token, &$str) {
# Handle $token provided by parseSpan by determining its nature and
# returning the corresponding value that should replace it.
#
switch ($token{0}) {
switch ($token[0]) {
case "\\":
return $this->hashPart("&#". ord($token{1}). ";");
return $this->hashPart("&#". ord($token[1]). ";");
case "`":
# Search for end marker in remaining text.
if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm',
Expand Down