mirror of
https://github.com/friendica/friendica
synced 2025-04-27 08:30:10 +00:00
Add new Content\Text\MarkdownParser
- Add autolinker to MarkdownParser->doAutoLinks() - Set hashtag_protection and url_filter_func properties of MarkdownParser
This commit is contained in:
parent
184b51ec56
commit
4d70e32829
2 changed files with 29 additions and 5 deletions
18
src/Content/Text/MarkdownParser.php
Normal file
18
src/Content/Text/MarkdownParser.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
namespace Friendica\Content\Text;
|
||||
|
||||
use Friendica\Util\Strings;
|
||||
use Michelf\MarkdownExtra;
|
||||
|
||||
class MarkdownParser extends MarkdownExtra
|
||||
{
|
||||
protected function doAutoLinks($text)
|
||||
{
|
||||
$text = parent::doAutoLinks($text);
|
||||
|
||||
$text = preg_replace_callback(Strings::autoLinkRegEx(),
|
||||
array($this, '_doAutoLinks_url_callback'), $text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue