Skip to content

Commit 979c4c8

Browse files
committed
dont strip excerpts from content
1 parent 10c2214 commit 979c4c8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

inc/class-importer.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ protected function update_post_from_markdown_source( $post_id ) {
294294
}
295295

296296
$title = null;
297-
if ( preg_match( '/^\n*#\s(.+)/', $markdown, $matches ) ) {
297+
if ( preg_match( '/^\n*#\s([^\n]+)/', $markdown, $matches ) ) {
298298
$title = $matches[1];
299-
$markdown = preg_replace( '/^\n*#\s(.+)/', '', $markdown );
299+
$markdown = preg_replace( '/^\n*#\s([\n]+)/', '', $markdown );
300300
}
301301
// Allow YAML override.
302302
if ( isset( $yaml['title'] ) ) {
@@ -306,9 +306,8 @@ protected function update_post_from_markdown_source( $post_id ) {
306306

307307
// Steal the first sentence as the excerpt
308308
$excerpt = '';
309-
if ( preg_match( '/^(.+)/', $markdown, $matches ) ) {
310-
$excerpt = $matches[1];
311-
$markdown = preg_replace( '/^(.+)/', '', $markdown );
309+
if ( preg_match( '/^([^\.]+)[\s$]/m', $markdown, $matches ) ) {
310+
$excerpt = $matches[1];
312311
}
313312

314313
// Transform to HTML and save the post

0 commit comments

Comments
 (0)