當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。