Class CI_Typography - echiong/testRepo GitHub Wiki
##Class CI_Typography
Typography Class
Category:
Helpers
Author:
ExpressionEngine Dev Team
Link:
http://codeigniter.com/user_guide/helpers/
Located at system/libraries/Typography.php
##Methods summary
public string auto_typography ( string $str, boolean $reduce_linebreaks = FALSE )
Auto Typography
This function converts text, making it typographically correct:
- Converts double spaces into paragraphs.
<li>Converts single line breaks into<br />
tags</li>
<li>Converts single and double quotes into correctly facing curly quote
entities.</li>
<li>Converts three dots into ellipsis.</li>
<li>Converts double dashes into em-dashes. - Converts two spaces into
entities</li>
Parameters
$str
string
$reduce_linebreaks
boolean
whether to reduce more then two consecutive newlines to two
Returns
string
public string format_characters ( string $str )
Format Characters
This function mainly converts double and single quotes to curly entities, but it also converts em-dashes, double spaces, and ampersands
Parameters
$str
string
Returns
string
public string _format_newlines ( string $str )
Format Newlines
Converts newline characters into eithertags or
Parameters
$str
string
Returns
string
public string _protect_characters ( array $match )
Protect Characters
Protects special characters from being formatted later We don't want quotes converted within tags so we'll temporarily convert them to {@DQ} and {@SQ} and we don't want double dashes converted to emdash entities, so they are marked with {@DD} likewise double spaces are converted to {@NBS} to prevent entity conversion
Parameters
$match
array
Returns
string
public string nl2br_except_pre ( string $str )
Convert newlines to HTML line breaks except within PRE tags
Parameters
$str
string
Returns
string
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="block_elements" id="$block_elements">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$block_elements
'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="skip_elements" id="$skip_elements">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$skip_elements
'p|pre|ol|ul|dl|object|table|h\d'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="inline_elements" id="$inline_elements">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$inline_elements
'a|abbr|acronym|b|bdo|big|br|button|cite|code|del|dfn|em|i|img|ins|input|label|map|kbd|q|samp|select|small|span|strong|sub|sup|textarea|tt|var'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="inner_block_required" id="$inner_block_required">
<td class="attributes"><code>
public
array
</code></td>
<td class="name">
$inner_block_required
array('blockquote')
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="last_block_element" id="$last_block_element">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$last_block_element
''
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="protect_braced_quotes" id="$protect_braced_quotes">
<td class="attributes"><code>
public
boolean
</code></td>
<td class="name">
$protect_braced_quotes
FALSE
<div class="description detailed">
</div>
</div></td>
</tr>
</table>