Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #112 from Cheddam/fix/support-variable-line-endings
Browse files Browse the repository at this point in the history
Added support for variable line endings.
  • Loading branch information
wilr committed Jun 29, 2016
2 parents fd9a7da + 1ab48be commit d495a68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/DocumentationParser.php
Expand Up @@ -69,7 +69,7 @@ public static function rewrite_code_blocks($md)
$end = false;
$debug = false;

$lines = explode("\n", $md);
$lines = preg_split('/\\r\\n|\\r|\\n/', $md);
$output = array();

foreach ($lines as $i => $line) {
Expand Down Expand Up @@ -394,7 +394,7 @@ public static function _rewrite_heading_anchors_callback($matches)
$headingText .= "-" . self::$heading_counts[$headingText];
}

return sprintf("%s {#%s}", preg_replace('/\n/', '', $heading), self::generate_html_id($headingText));
return sprintf("%s {#%s}", preg_replace('/\\r\\n|\\r|\\n/', '', $heading), self::generate_html_id($headingText));
}

/**
Expand Down

0 comments on commit d495a68

Please sign in to comment.