File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -296,17 +296,17 @@ protected function update_post_from_markdown_source( $post_id ) {
296296$ title = null ;
297297if ( preg_match ( '/^\n*#\s([^\n]+)/ ' , $ markdown , $ matches ) ) {
298298$ title = $ matches [1 ];
299- $ markdown = preg_replace ( '/^\n*#\s([\n]+)/ ' , '' , $ markdown );
299+ $ markdown = preg_replace ( '/^\n*#\s([^ \n]+)/ ' , '' , $ markdown );
300300}
301301// Allow YAML override.
302302if ( isset ( $ yaml ['title ' ] ) ) {
303303$ title = $ yaml ['title ' ];
304304}
305305$ markdown = trim ( $ markdown );
306306
307- // Steal the first sentence as the excerpt
307+ // Steal the first paragraph as the excerpt
308308$ excerpt = '' ;
309- if ( preg_match ( '/^([^\.]+)[\s$]/m ' , $ markdown , $ matches ) ) {
309+ if ( preg_match ( '/^(.*?)\n\n/ ' , $ markdown , $ matches ) ) {
310310$ excerpt = $ matches [1 ];
311311}
312312
You can’t perform that action at this time.
0 commit comments