My Project
 All Data Structures Namespaces Functions Variables
Public Member Functions | Data Fields
CI_Typography Class Reference

Public Member Functions

 auto_typography ($str, $reduce_linebreaks=FALSE)
 
 format_characters ($str)
 
 _format_newlines ($str)
 
 _protect_characters ($match)
 
 nl2br_except_pre ($str)
 

Data Fields

 $block_elements = 'address|blockquote|div|dl|fieldset|form|h\d|hr|noscript|object|ol|p|pre|script|table|ul'
 
 $skip_elements = 'p|pre|ol|ul|dl|object|table|h\d'
 
 $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'
 
 $inner_block_required = array('blockquote')
 
 $last_block_element = ''
 
 $protect_braced_quotes = FALSE
 

Member Function Documentation

_format_newlines (   $str)

Format Newlines

Converts newline characters into either

tags or

public

Parameters
string
Returns
string
_protect_characters (   $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 {} and {} and we don't want double dashes converted to emdash entities, so they are marked with {} likewise double spaces are converted to {} to prevent entity conversion

public

Parameters
array
Returns
string
auto_typography (   $str,
  $reduce_linebreaks = FALSE 
)

Auto Typography

This function converts text, making it typographically correct:

  • Converts double spaces into paragraphs.
  • Converts single line breaks into
    tags
  • Converts single and double quotes into correctly facing curly quote entities.
  • Converts three dots into ellipsis.
  • Converts double dashes into em-dashes.
  • Converts two spaces into entities

public

Parameters
string
boolwhether to reduce more then two consecutive newlines to two
Returns
string
format_characters (   $str)

Format Characters

This function mainly converts double and single quotes to curly entities, but it also converts em-dashes, double spaces, and ampersands

public

Parameters
string
Returns
string
nl2br_except_pre (   $str)

Convert newlines to HTML line breaks except within PRE tags

public

Parameters
string
Returns
string

The documentation for this class was generated from the following file: