Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Improve markdown performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Mar 11, 2015
1 parent ea66989 commit 27ff28b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"php": ">=5.3.23",
"ext-gd": "*",
"ext-json": "*",
"erusev/parsedown-extra": "~0.7",
"francodacosta/phmagick": "0.4.*@dev",
"intervention/image": "~2.1",
"ircmaxell/random-lib": "~1.1",
"leafo/scssphp": "~0.1",
"maennchen/zipstream-php": "~0.3",
"michelf/php-markdown": "~1.4",
"moontoast/math": "~1.1",
"reprovinci/solr-php-client": "~1.0",
"rhumsaa/uuid": "~2.8",
Expand Down
4 changes: 3 additions & 1 deletion core/controllers/components/UtilityComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,9 @@ public static function filterHtmlTags($text)
*/
public static function markdown($text)
{
return Michelf\MarkdownExtra::defaultTransform($text);
$extra = new \ParsedownExtra();

return $extra->text($text);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/views/community/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ $strippedDescription = strip_tags($description);
<div id="communitySubtitle" class="genericSubtitle" style="color:grey;">
<?php
if (!empty($rawDescription)) {
echo substr($this->escape($strippedDescription), 0, 240).'<a href="#" class="more">More &raquo;</a>';
echo substr($this->escape($strippedDescription), 0, 240).' <a href="#" class="more">More &raquo;</a>';
}
?>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testFolderReadme()

$resp = $this->_callRestApi('GET', '/readmes/folder/'.$publicFolder->getKey());
$this->_assertStatusOk($resp);
$this->assertEquals($resp["body"]->data->text, "<p>This is a readme</p>\n");
$this->assertEquals('<p>This is a readme</p>', $resp['body']->data->text);
}

/** test readme on community */
Expand Down Expand Up @@ -107,6 +107,6 @@ public function testCommunityReadme()

$resp = $this->_callRestApi('GET', '/readmes/community/'.$comm->getKey());
$this->_assertStatusOk($resp);
$this->assertEquals($resp["body"]->data->text, "<p>This is a readme</p>\n");
$this->assertEquals('<p>This is a readme</p>', $resp['body']->data->text);
}
}

0 comments on commit 27ff28b

Please sign in to comment.