function get() { $text = preg_replace_callback('!(?=[^\\]])\\((' . implode('|', $this->tags) . '):(.*?)\\)!i', array($this, 'parse'), (string) $this->text); $text = preg_replace_callback('!```(.*?)```!is', array($this, 'code'), $text); $text = $this->mdown ? markdown($text) : $text; $text = $this->smartypants ? smartypants($text) : $text; return $text; }
function format($text) { $text = markdown($text); $text = smartypants($text); $search = array("<table>", "</table>"); $replace = array("<figure class='table'><table>", "</table></figure>"); $text = str_replace($search, $replace, $text); return $text; }
public function parse() { if (!$this->field) { return ''; } $text = $this->field->value; // pre filters foreach (static::$pre as $filter) { $text = call_user_func_array($filter, array($this, $text)); } // tags $text = preg_replace_callback('!(?=[^\\]])\\([a-z0-9]+:.*?\\)!i', array($this, 'tag'), $text); // markdownify $text = markdown($text); // smartypants if (kirby()->option('smartypants')) { $text = smartypants($text); } // post filters foreach (static::$post as $filter) { $text = call_user_func_array($filter, array($this, $text)); } return $text; }
<meta name="twitter:image:src" content="http://bradshawsguide.org<?php echo $page->images()->first()->url(); ?> "> <?php } ?> <meta name="twitter:card" content="summary"> <title><?php if ($page->isHomePage() == false) { echo html($page->title); ?> - <?php } echo smartypants($site->title); ?> </title> </head> <body> <header role="banner" id="top"> <h1><a href="<?php echo url(); ?> ">Bradshaw’s <span>Guide</span></a></h1> <a href="#nav">Jump to navigation</a> <a href="#search">Jump to search</a> </header><!--/@banner--> <main role="main" id="main">
</h2> <ul class="stations listing"> <?php foreach ($items as $item) { ?> <li><a href="<?php echo $item->url(); ?> "<?php if ($item->text() == '') { ?> class="unremarkable"<?php } ?> ><?php echo smartypants($item->title()); ?> </a></li> <?php } ?> </ul> <?php } } ?> </section> <?php snippet('shorturl'); snippet('prevnext'); ?>
"><?php echo smartypants($item->title()); ?> </a></h2> <?php $regions = $item->children()->sortBy('title', 'asc'); ?> <ul class="regions listing"> <?php foreach ($regions as $region) { ?> <li><a href="<?php echo $region->url(); ?> "><?php echo smartypants($region->title()); ?> </a></li> <?php } ?> </ul> <?php } } } ?> </section> <?php if (!isset($_GET['ajax'])) { snippet('_footer');
?> </section> <footer> <details class="related-links"> <summary>Related Links</summary> <?php if ($page->related) { echo kirbytext($page->related()); } else { ?> <p><a href="http://en.wikipedia.org/w/index.php?search=<?php echo urlencode($page->title()); ?> "><?php echo smartypants($page->title()); ?> on Wikipedia</a></p> <?php } ?> </details> </footer> <?php snippet('shorturl'); ?> </article> <?php if (!isset($_GET['ajax'])) { snippet('_footer');
?> <?php if ($page->related()) { ?> <section> <h1>Related</h1> <ul class="listing"> <?php foreach (related($page->related()) as $related) { ?> <li><a href="<?php echo $related->url(); ?> "><?php echo smartypants($related->title()); ?> </a></li> <?php } ?> </ul> </section> <?php } ?> <?php snippet('shorturl'); ?> </article>
<?php include $dr . "header.php"; ?> <main> <nav><a href="/#panel-<?php echo $cat_id; ?> " class="back"><img src="/i/chevron-left.svg" alt="Back to"> <?php echo $category; ?> </a></nav> <h1><?php echo smartypants($heading); ?> </h1> <article class="prose"> <?php if (!$error) { echo format($text); } else { echo format("# Oh dear.\n"); echo format($title); } ?> </article> </main>
<ul class="<?php echo $type; ?> listing"> <?php foreach ($items as $item) { if ($item->shorttitle() != null) { $title = $item->shorttitle(); } else { $title = $item->title(); } ?> <li><a href="<?php echo $item->url(); ?> "<?php if ($item->text() == '') { ?> class="unremarkable"<?php } ?> ><?php echo smartypants(html($title)); ?> </a></li> <?php } ?> </ul> <?php }
<nav role="navigation" id="nav"> <h1 class="hidden">Explore <?php echo smartypants($site->short_title()); ?> Handbook</h1> <ul> <?php foreach ($pages->visible() as $page) { ?> <li> <a href="<?php echo $page->url(); ?> "<?php e($page->isOpen(), ' class="active"'); ?> > <?php echo $page->title(); ?> </a> </li> <?php } ?> </ul> <a href="#top" class="return">▴ Return to top</a> </nav><!--/@navigation-->
<li><a href="/regions/england/london/places-of-amusement">Places of Amusement, &c.</a></li> <li><a href="/regions/england/london/summary">London Summary</a></li> <?php } ?> <?php foreach ($routes as $route) { ?> <?php if ($route->text() != '') { ?> <li><a href="<?php echo $route->url(); ?> "><?php echo smartypants($route->title()); ?> </a></li> <?php } ?> <?php } ?> </ul> <?php } } ?> </section> <?php
*/ kirbytext::$tags['blockquote'] = array('attr' => array('lang', 'attribution', 'cite', 'link'), 'html' => function ($tag) { $text = $tag->attr('blockquote'); $lang = $tag->attr('lang'); $attribution = $tag->attr('attribution'); $cite = $tag->attr('cite'); $link = $tag->attr('link'); if (!empty($lang)) { $lang_attr = ' lang="' . $lang . '"'; } else { $lang_attr = ''; } $html = '<figure class="Blockquote">'; $html .= '<blockquote' . $lang_attr . '>'; $html .= kirbytext($text); $html .= '</blockquote>'; // open figcaption with attribution, citation and link if one is available if (!empty($attribution)) { if (!empty($cite)) { if (!empty($link)) { $html .= '<figcaption>' . smartypants($attribution) . ' <cite><a href="' . html($link) . '" rel="external nofollow">' . smartypants($cite) . '</a></cite></figcaption>'; } else { $html .= '<figcaption>' . smartypants($attribution) . ' <cite>' . smartypants($cite) . '</cite></figcaption>'; } } else { $html .= '<figcaption>' . smartypants($attribution) . '</figcaption>'; } } $html .= '</figure>'; return $html; });
</h1> <?php if ($page->hasPrev() == true) { ?> <a href="<?php echo $page->prev()->url(); ?> " rel="prev"><span><?php echo smartypants($page->prev()->title()); ?> </span></a> <?php } ?> <?php if ($page->hasNext() == true) { ?> <a href="<?php echo $page->next()->url(); ?> " rel="next"><span><?php echo smartypants($page->next()->title()); ?> </span></a> <?php } ?> </nav><!--/.prevnext-->
"/> <?php } if ($page->hasImages()) { ?> <meta name="twitter:image:src" content="http://bradshawsguide.org<?php echo $page->images()->first()->url(); ?> "> <?php } ?> <title><?php if (!$page->isHomePage()) { echo smartypants(html($page->title())); ?> - <?php } echo smartypants(html($site->title())); ?> </title> </head> <body> <?php snippet('banner'); ?> <main role="main" id="main">
?> listing"> <?php foreach ($items as $item) { ?> <?php if ($item->short_title()->isNotEmpty()) { $title = $item->short_title(); } else { $title = $item->title(); } ?> <li><a href="<?php echo $item->url(); ?> "<?php if ($item->text()->isEmpty()) { ?> class="unremarkable"<?php } ?> ><?php echo smartypants($title); ?> </a></li> <?php } ?> </ul> <?php }
<nav class="prevnext"> <h1 class="hidden">Previous and Next <?php echo $page->parent->title; ?> </h1> <?php if ($page->hasPrev() == true) { ?> <a href="<?php echo $page->prev()->url(); ?> " rel="prev"><span><?php echo smartypants($prevTitle); ?> </span></a> <?php } if ($page->hasNext() == true) { ?> <a href="<?php echo $page->next()->url(); ?> " rel="next"><span><?php echo smartypants($nextTitle); ?> </span></a> <?php } ?> </nav><!--/.prevnext-->
?> <ul> <?php } ?> <?php foreach ($routes as $connection) { ?> <?php if ($connection->title() !== $page->title()) { ?> <li><a href="<?php echo $connection->url(); ?> "><?php echo smartypants($connection->destination()); ?> </a></li> <?php } ?> <?php } ?> <?php if ($type == 'interchange') { ?> </ul> <?php } ?>
</main><!--/@main--> <nav role="navigation" id="nav"> <h1 class="hidden">Explore <?php echo smartypants($site->shorttitle); ?> Handbook</h1> <ul> <?php foreach ($pages->visible() as $page) { ?> <li><a href="<?php echo $page->url(); ?> " id="nav-<?php echo str::lower($page->title); ?> "<?php echo $page->isOpen() ? ' class="is-active"' : ''; ?> ><?php echo html($page->title()); ?> </a></li> <?php } ?> </ul> <a href="#top" class="return">▴ Return to top</a> </nav><!--/@navigation-->
<?php /** * Smartypants Plugin * * @author Jonathan van Wunnik <*****@*****.**> * @version 1.0.0 */ if ($this->options['smartypants']) { field::$methods['smartypants'] = function ($field) { $field->value = smartypants($field); return $field; }; }