当前位置: 首页>>代码示例>>PHP>>正文


PHP Parsedown::setUrlsLinked方法代码示例

本文整理汇总了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);
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:14,代码来源:CommonMarkTest.php

示例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);
}
开发者ID:pafnuty-fansoro-plugins,项目名称:morfy-parsedown,代码行数:11,代码来源:parsedown.php

示例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>&nbsp;&nbsp;';
                } 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
}
开发者ID:JordanPak,项目名称:UCFBands,代码行数:101,代码来源:masonry-blocks.php

示例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);
 }
开发者ID:nikkiczx,项目名称:phproject,代码行数:11,代码来源:view.php

示例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);
}
开发者ID:matthew0x40,项目名称:apply,代码行数:15,代码来源:functions.php

示例6: setUrlsLinked

 /**
  * 
  *
  * @static 
  */
 public static function setUrlsLinked($urlsLinked)
 {
     return \Parsedown::setUrlsLinked($urlsLinked);
 }
开发者ID:9IPHP,项目名称:LaravelBlog,代码行数:9,代码来源:_ide_helper.php

示例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) {
开发者ID:domynation,项目名称:domynation-framework,代码行数:31,代码来源:container.php


注:本文中的Parsedown::setUrlsLinked方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。