File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
src/frontend/components/App Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 89
89
"redbox-react" : " ^1.5.0" ,
90
90
"redux" : " ^4.0.0" ,
91
91
"redux-actions" : " ^2.2.1" ,
92
+ "remove-markdown" : " ^0.3.0" ,
92
93
"sass-loader" : " ^7.0.3" ,
93
94
"screenfull" : " ^3.3.2" ,
94
95
"style-loader" : " ^0.21.0" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { connect } from 'react-redux';
4
4
import Promise from 'bluebird' ;
5
5
import { Helmet } from 'react-helmet' ;
6
6
import AutosizeInput from 'react-input-autosize' ;
7
+ import removeMarkdown from 'remove-markdown' ;
7
8
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
8
9
import faPlus from '@fortawesome/fontawesome-free-solid/faPlus' ;
9
10
import {
@@ -228,8 +229,12 @@ class App extends BaseComponent {
228
229
const { files } = this . props . current ;
229
230
const readmeFile = files . find ( file => file . name === 'README.md' ) ;
230
231
if ( ! readmeFile ) return '' ;
231
- const groups = / ^ \s * # .* \n + ( [ ^ \n ] + ) / . exec ( readmeFile . content ) ;
232
- return groups && groups [ 1 ] || '' ;
232
+ const lines = readmeFile . content . split ( '\n' ) ;
233
+ lines . shift ( ) ;
234
+ while ( lines . length && ! lines [ 0 ] . trim ( ) ) lines . shift ( ) ;
235
+ let descriptionLines = [ ] ;
236
+ while ( lines . length && lines [ 0 ] . trim ( ) ) descriptionLines . push ( lines . shift ( ) ) ;
237
+ return removeMarkdown ( descriptionLines . join ( ' ' ) ) ;
233
238
}
234
239
235
240
render ( ) {
You can’t perform that action at this time.
0 commit comments