本文整理汇总了PHP中Parsedown::setUrlsLinked方法的典型用法代码示例。如果您正苦于以下问题:PHP Parsedown::setUrlsLinked方法的具体用法?PHP Parsedown::setUrlsLinked怎么用?PHP Parsedown::setUrlsLinked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parsedown
的用法示例。
在下文中一共展示了Parsedown::setUrlsLinked方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Parsedown
/**
* @dataProvider data
* @param $section
* @param $markdown
* @param $expectedHtml
*/
function test_($section, $markdown, $expectedHtml)
{
$Parsedown = new Parsedown();
$Parsedown->setUrlsLinked(false);
$actualHtml = $Parsedown->text($markdown);
$actualHtml = $this->normalizeMarkup($actualHtml);
$this->assertEquals($expectedHtml, $actualHtml);
}
示例2: parseMdText
function parseMdText($content)
{
$parseDownConfig = Morfy::$config['parsedown'];
if ($parseDownConfig['extra']) {
$Parsedown = new ParsedownExtra();
} else {
$Parsedown = new Parsedown();
}
$Parsedown->setUrlsLinked($parseDownConfig['autoLink']);
return $Parsedown->text($content);
}
示例3: show_masonry_grid
//.........这里部分代码省略.........
// Use Layout Option with container output
echo '<section class="masonry-' . $masonry_column_layout . '-grid">';
echo '<div class="masonry-' . $masonry_column_layout . '-grid-sizer"></div>';
echo '<div class="masonry-' . $masonry_column_layout . '-gutter-sizer"></div>';
//-- BLOCK LOOP --//
foreach ($blocks as $block) {
// Get Block Meta Data
$block_title = esc_attr($block['title']);
$block_icon = esc_attr($block['icon']);
$block_width = esc_attr($block['width']);
$block_is_featured = esc_attr($block['featured']);
$block_content = $block['block-content'];
$block_render_html = esc_attr($block['render_html']);
$block_remove_background_padding = esc_attr($block['remove-background']);
$block_is_breaker = esc_attr($block['breaker']);
// If there's only one block and there's no content; display nothing.
if (sizeof($blocks) == 1 && $block_content == '' && $block_title == '') {
break;
}
// If the block isn't a "breaker", proceed as normal
if ($block_is_breaker == false) {
// SET INITIAL CLASSES
$block_classes = 'block masonry-block masonry-block-size--' . $block_width;
// Featured?
if ($block_is_featured == true) {
$block_classes .= ' block-featured';
}
// Background/Padding Disabled?
if ($block_remove_background_padding) {
$block_classes .= ' block-remove-background-padding';
}
// Block Icon?
if ($block_icon) {
$block_icon = '<i class="fa fa-' . $block_icon . '"></i> ';
} else {
$block_icon = '';
}
?>
<!-- MASONRY BLOCK -->
<div class="<?php
echo $block_classes;
?>
">
<!-- BLOCK TITLE & ICON -->
<?php
if ($block_title != '') {
?>
<h2 class="block-header"><?php
echo $block_icon . $block_title;
?>
</h2>
<?php
}
?>
<?php
// FOR TESTING: Show Block Width
?>
<?php
//echo '<h4 style="color:red;">' . $block_width . '</h4>';
?>
<div class="entry-content">
<!-- BLOCK MARKDOWN CONTENT -->
<?php
// Parse block content into Markdown HTML
if ($block_render_html) {
echo apply_filters('the_content', $block_content);
} else {
$block_content = $Parsedown->setUrlsLinked(false)->text($block_content);
echo apply_filters('the_content', $block_content);
}
?>
</div><!-- /.entry-content -->
</div><!-- /BLOCK -->
<?php
} else {
?>
<!-- MASONRY BLOCK -->
<div class="masonry-block masonry-block-size--one-whole masonry-breaker-block"></div><!-- /BLOCK -->
<?php
}
// else
}
// foreach block
// End Masonry Grid Container
echo '</div>';
}
// PASSWORD PROTECTION
}
示例4: _parseMarkdown
/**
* Passes a string through the Markdown parser
* @param string $str
* @return string
*/
protected function _parseMarkdown($str)
{
$mkd = new Parsedown();
$mkd->setUrlsLinked(false);
return $mkd->text($str);
}
示例5: markdown
function markdown($text, $allow_html = false)
{
static $parsedown = null;
if ($parsedown === null) {
include BOOTSTRAP_ROOT . 'includes/Parsedown.php';
$parsedown = new Parsedown();
}
$parsedown->setBreaksEnabled(true);
// should convert \n to <br/>?
$parsedown->setMarkupEscaped(!$allow_html);
// should escape HTML?
$parsedown->setUrlsLinked(true);
// should automatically link urls?
return $parsedown->text($text);
}
示例6: setUrlsLinked
/**
*
*
* @static
*/
public static function setUrlsLinked($urlsLinked)
{
return \Parsedown::setUrlsLinked($urlsLinked);
}
示例7: function
return new \Domynation\Cache\RedisCache(REDIS_HOST, REDIS_PORT);
default:
return new \Domynation\Cache\InMemoryCache();
break;
}
}, \Domynation\Communication\WebSocketInterface::class => function () {
switch (WEBSOCKET_DRIVER) {
case 'pusher':
default:
return new \Domynation\Communication\PusherWebSocket(PUSHER_API_KEY, PUSHER_API_SECRET_KEY, PUSHER_APP_ID);
break;
}
}, \Domynation\Communication\MarkdownParserInterface::class => function () {
$parsedown = new Parsedown();
$parsedown->setBreaksEnabled(true);
$parsedown->setUrlsLinked(true);
$parsedown->setMarkupEscaped(true);
return new \Domynation\Communication\ParsedownMarkdownParser($parsedown);
}, \Domynation\Security\PasswordInterface::class => function () {
switch (PASSWORD_DRIVER) {
case 'md5':
return new \Domynation\Security\Md5Password();
break;
case 'native':
default:
return new \Domynation\Security\NativePassword();
break;
}
}, \Domynation\Security\PasswordGeneratorInterface::class => function () {
return new \Domynation\Security\BasicPasswordGenerator();
}, \Domynation\Authentication\AuthenticatorInterface::class => function (\Doctrine\DBAL\Connection $db, \Domynation\Session\SessionInterface $session, \Domynation\Security\PasswordInterface $password) {