Browse Source

also parse markdown in excerpts

Stijn-Flipper 11 năm trước cách đây
mục cha
commit
91bb998b84
2 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 3 2
      lib/markdown/markdown_extended.php
  2. 1 1
      lib/pico.php

+ 3 - 2
lib/markdown/markdown_extended.php

@@ -30,8 +30,9 @@ class MarkdownExtraExtended_Parser extends MarkdownExtra_Parser {
 	function doHardBreaks($text) {
 		# Do hard breaks:
 		# EXTENDED: changed to allow breaks without two spaces and just one new line
-		# original code /* return preg_replace_callback('/ {2,}\n/', */
-		return preg_replace_callback('/ *\n/', 
+		# to activate this, uncomment the following code:
+		# return preg_replace_callback('/ *\n/', 
+		return preg_replace_callback('/ {2,}\n/',
 			array(&$this, '_doHardBreaks_callback'), $text);
 	}
 

+ 1 - 1
lib/pico.php

@@ -246,7 +246,7 @@ class Pico {
 				'date' => isset($page_meta['date']) ? $page_meta['date'] : '',
 				'date_formatted' => isset($page_meta['date']) ? date($config['date_format'], strtotime($page_meta['date'])) : '',
 				'content' => $page_content,
-				'excerpt' => $this->limit_words(strip_tags($page_content), $excerpt_length)
+				'excerpt' => $this->limit_words($page_content, $excerpt_length)
 			);
 
 			// Extend the data provided with each page by hooking into the data array