Permalink
Browse files

Fixed problem with list lines not being formatted

Added CVS hooks for <hr> and Question/Answer (Q. and A.) lines
  • Loading branch information...
1 parent ab48c1b commit b2878fc5ae4b317ba63aeff1b5b6ee4e9362a461 thepurpleblob committed May 22, 2003
Showing with 19 additions and 2 deletions.
  1. +19 −2 lib/wiki.php
View
@@ -144,6 +144,9 @@ function do_list( $line ) {
break;
}
}
+
+ // apply formatting to remainder of line
+ $line = $this->line_replace( $line );
// generate appropriate list tag
$ltag = "";
@@ -172,13 +175,13 @@ function line_replace( $line ) {
}
// ---- (at least) means a <HR>
- $line = eregi_replace( "^-{4}.*", "<hr />", $line );
+ $line = eregi_replace( "^-{4}.*", "<div class=\"hr\"><hr /></div>", $line );
// is this a list line (starts with * # ; :)
if (eregi( "^[*#;:] ", $line )) {
$line = $this->do_list( $line );
}
-
+
// typographic conventions
$line = eregi_replace( "--", "&#8212;", $line );
$line = eregi_replace( " - ", " &#8211; ", $line );
@@ -289,6 +292,20 @@ function format( $content ) {
$buffer = $buffer . eregi_replace( "^\%","",$line) . "\n";
$this->block_state = STATE_NOTIKI;
}
+ else
+ if (eregi("^Q. ",$line) ) {
+ // Question - para with a question class
+ $buffer = $buffer . "<p class=\"question\">\n";
+ $buffer = $buffer . eregi_replace( "^Q. ","",$line) . "\n";
+ $this->block_state = STATE_PARAGRAPH;
+ }
+ else
+ if (eregi("^A. ",$line) ) {
+ // Answer - para with an answer class
+ $buffer = $buffer . "<p class=\"answer\">\n";
+ $buffer = $buffer . eregi_replace( "^A. ","",$line ) . "\n";
+ $this->block_state = STATE_PARAGRAPH;
+ }
else {
// ordinary paragraph
$buffer = $buffer . "<p>\n";

0 comments on commit b2878fc

Please sign in to comment.