Continued working on typography class and docs
diff --git a/system/application/config/config.php b/system/application/config/config.php
index 71ebd30..7dc6151 100644
--- a/system/application/config/config.php
+++ b/system/application/config/config.php
@@ -11,7 +11,7 @@
| http://example.com/
|
*/
-$config['base_url'] = "";
+$config['base_url'] = "http://127.0.0.1/EllisLab/_Development/CodeIgniter/";
/*
|--------------------------------------------------------------------------
diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php
index 2c5c588..11acea1 100644
--- a/system/helpers/typography_helper.php
+++ b/system/helpers/typography_helper.php
@@ -38,26 +38,11 @@
{
function nl2br_except_pre($str)
{
- $ex = explode("pre>",$str);
- $ct = count($ex);
+ $CI =& get_instance();
- $newstr = "";
- for ($i = 0; $i < $ct; $i++)
- {
- if (($i % 2) == 0)
- {
- $newstr .= nl2br($ex[$i]);
- }
- else
- {
- $newstr .= $ex[$i];
- }
+ $CI->load->library('typography');
- if ($ct - 1 != $i)
- $newstr .= "pre>";
- }
-
- return $newstr;
+ return $CI->typography->nl2br_except_pre($str);
}
}
diff --git a/system/libraries/Typography.php b/system/libraries/Typography.php
index b058fda..dd5f928 100644
--- a/system/libraries/Typography.php
+++ b/system/libraries/Typography.php
@@ -286,6 +286,40 @@
{
$this->reduce_empty_lines = ($val === FALSE) ? FALSE : TRUE;
}
+
+ // ------------------------------------------------------------------------
+
+ /**
+ * Convert newlines to HTML line breaks except within PRE tags
+ *
+ * @access public
+ * @param string
+ * @return string
+ */
+ function nl2br_except_pre($str)
+ {
+ $ex = explode("pre>",$str);
+ $ct = count($ex);
+
+ $newstr = "";
+ for ($i = 0; $i < $ct; $i++)
+ {
+ if (($i % 2) == 0)
+ {
+ $newstr .= nl2br($ex[$i]);
+ }
+ else
+ {
+ $newstr .= $ex[$i];
+ }
+
+ if ($ct - 1 != $i)
+ $newstr .= "pre>";
+ }
+
+ return $newstr;
+ }
+
}
// END Typography Class
diff --git a/user_guide/libraries/parser.html b/user_guide/libraries/parser.html
index 5743d2d..7d6b2af 100644
--- a/user_guide/libraries/parser.html
+++ b/user_guide/libraries/parser.html
@@ -199,7 +199,7 @@
·
<a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
-Next Topic: <a href="unit_testing.html">Unit Testing Class</a>
+Next Topic: <a href="typography.html">Typography</a>
</p>
<p><a href="http://codeigniter.com">CodeIgniter</a> · Copyright © 2006-2008 · <a href="http://ellislab.com/">Ellislab, Inc.</a></p>
</div>
diff --git a/user_guide/libraries/unit_testing.html b/user_guide/libraries/unit_testing.html
index ffb3d95..3763232 100644
--- a/user_guide/libraries/unit_testing.html
+++ b/user_guide/libraries/unit_testing.html
@@ -192,7 +192,7 @@
<div id="footer">
<p>
-Previous Topic: <a href="parser.html">Template Parser Class</a>
+Previous Topic: <a href="typography.html">Typography Class</a>
·
<a href="#top">Top of Page</a> ·
<a href="../index.html">User Guide Home</a> ·
diff --git a/user_guide/nav/nav.js b/user_guide/nav/nav.js
index cbff6f3..f8320dd 100644
--- a/user_guide/nav/nav.js
+++ b/user_guide/nav/nav.js
@@ -91,6 +91,7 @@
'<li><a href="'+base+'libraries/sessions.html">Session Class</a></li>' +
'<li><a href="'+base+'libraries/trackback.html">Trackback Class</a></li>' +
'<li><a href="'+base+'libraries/parser.html">Template Parser Class</a></li>' +
+ '<li><a href="'+base+'libraries/typography.html">Typography Class</a></li>' +
'<li><a href="'+base+'libraries/unit_testing.html">Unit Testing Class</a></li>' +
'<li><a href="'+base+'libraries/uri.html">URI Class</a></li>' +
'<li><a href="'+base+'libraries/user_agent.html">User Agent Class</a></li>' +
diff --git a/user_guide/toc.html b/user_guide/toc.html
index ba147f6..a87139b 100644
--- a/user_guide/toc.html
+++ b/user_guide/toc.html
@@ -144,6 +144,7 @@
<li><a href="./libraries/sessions.html">Session Class</a></li>
<li><a href="./libraries/trackback.html">Trackback Class</a></li>
<li><a href="./libraries/parser.html">Template Parser Class</a></li>
+<li><a href="./libraries/typography.html">Typography Class</a></li>
<li><a href="./libraries/unit_testing.html">Unit Testing Class</a></li>
<li><a href="./libraries/uri.html">URI Class</a></li>
<li><a href="./libraries/user_agent.html">User Agent Class</a></li>