當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Markdown::transform方法代碼示例

本文整理匯總了PHP中Michelf\Markdown::transform方法的典型用法代碼示例。如果您正苦於以下問題:PHP Markdown::transform方法的具體用法?PHP Markdown::transform怎麽用?PHP Markdown::transform使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Michelf\Markdown的用法示例。


在下文中一共展示了Markdown::transform方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 /**
  * Handle the command.
  *
  * @param Markdown $markdown
  */
 public function handle(Markdown $markdown)
 {
     $this->command->info(strip_tags($markdown->transform(file_get_contents(base_path('LICENSE.md')))));
     if (!$this->command->confirm('Do you agree to the provided license and terms of service?')) {
         $this->command->error('You must agree to the license and terms of service before continuing.');
         exit;
     }
 }
開發者ID:huglester,項目名稱:streams-platform,代碼行數:13,代碼來源:ConfirmLicense.php

示例2: getContentHtml

 public function getContentHtml()
 {
     if ($this->codeType == 'html') {
         return $this->ContentHtml = $this->content;
     } else {
         $md = new Markdown();
         $md->no_markup = true;
         $md->no_entities = true;
         return $this->ContentHtml = $md->transform($this->content);
     }
 }
開發者ID:ahyswang,項目名稱:eva-engine,代碼行數:11,代碼來源:Comment.php

示例3: it_should_throw_an_exception_on_an_exception

 public function it_should_throw_an_exception_on_an_exception(Markdown $markdown)
 {
     $markdown->transform('bar')->willThrow('Exception');
     $this->shouldThrow('TheWilkyBarKid\\TextFilter\\Exception\\TextFilterFailedException')->during('filter', array('foo'));
 }
開發者ID:thewilkybarkid,項目名稱:text-filter,代碼行數:5,代碼來源:MarkdownTextFilterAdapterSpec.php

示例4:

 function it_parses_markdown(\Michelf\Markdown $markdown)
 {
     $markdown->transform('# Markdown')->shouldBeCalled()->willReturn('<h1>Markdown</h1>');
     $this->beConstructedWith($markdown);
     $this->parse('# Markdown')->shouldReturn('<h1>Markdown</h1>');
 }
開發者ID:petersuhm,項目名稱:thin,代碼行數:6,代碼來源:MarkdownParserSpec.php

示例5: transform

 /**
  * {@inheritdoc}
  */
 public function transform($content)
 {
     return parent::transform($content);
 }
開發者ID:kanzuka,項目名稱:sculpin,代碼行數:7,代碼來源:PhpMarkdownParser.php

示例6: rendered

 /**
  * Return the rendered content.
  *
  * @return string
  */
 public function rendered()
 {
     return $this->markdown->transform($this->object->getValue());
 }
開發者ID:visualturk,項目名稱:markdown-field_type,代碼行數:9,代碼來源:MarkdownFieldTypePresenter.php

示例7: apply

 public function apply($content)
 {
     // apply custom behaviour here
     return parent::transform($content);
 }
開發者ID:EhteshamMehmood,項目名稱:BlogMVC,代碼行數:5,代碼來源:Markdown.php

示例8: doFilter

 protected function doFilter($text)
 {
     return $this->markdown->transform($text);
 }
開發者ID:thewilkybarkid,項目名稱:text-filter,代碼行數:4,代碼來源:MarkdownTextFilterAdapter.php

示例9: getHtml

 /**
  * Returns the parsed content as HTML
  *
  * @param string $content
  *
  * @return string
  */
 public function getHtml($content)
 {
     return $this->markdown->transform($this->getContentPart($content, static::CONTENT));
 }
開發者ID:jtallant,項目名稱:skimpy-engine,代碼行數:11,代碼來源:FileToContentFile.php

示例10: parseLine

 /**
  * @param string $line
  * @param array $args [optionally]
  * @param array $options [optionally]
  * @return mixed
  */
 public function parseLine($line, array $args = [], array $options = [])
 {
     return $this->markdown->transform($line);
 }
開發者ID:minetro,項目名稱:uniparser,代碼行數:10,代碼來源:MarkdownAdapter.php

示例11: function

 }
 // Handle page inclusions `{% include page xxx %}`
 $source = preg_replace_callback('!\\{%\\s+include\\s+page\\s+(' . GP_PAGE_REGEX . ')\\s+%\\}!', function ($m) {
     return is_page($m[1]) ? get_page($m[1]) : $m[1];
 }, $source);
 // Convert integers in URLs to internal page links
 $markdownParser = new Markdown();
 $markdownParser->url_filter_func = function ($url) {
     $m = array();
     if (preg_match('!^\\s*(' . GP_PAGE_REGEX . ')\\s*$!', $url, $m)) {
         $url = "../page/{$m[1]}";
     }
     return $url;
 };
 // Transform the markdown
 $page = $markdownParser->transform($source);
 // Transform page links
 $page = preg_replace_callback('!page (' . GP_PAGE_REGEX . ')!', function ($m) {
     if (is_page($m[1])) {
         return '<a href="../page/' . $m[1] . '">' . $m[0] . '</a>';
     } else {
         return $m[0];
     }
 }, $page);
 // Transform dialogue links `(xxx)> blablabla`
 $page = preg_replace_callback('!\\s*\\((' . GP_PAGE_REGEX . ')\\)\\s*>\\s*(.+?)(</p>)?$!m', function ($m) use($id) {
     if (is_page($m[1])) {
         if ($m[1] != $id) {
             return '&gt; <a class="talk" href="../page/' . $m[1] . '">' . $m[2] . '</a><br>' . (isset($m[3]) ? '</p>' : '');
         } else {
             return '';
開發者ID:Goutte,項目名稱:gamebook-cv,代碼行數:31,代碼來源:index.php


注:本文中的Michelf\Markdown::transform方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。