File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,9 +31,11 @@ module.exports = {
3131 let start = parseStart ( $item )
3232 if ( prev ) prev . stop = start
3333 const stop = start . add ( 30 , 'm' )
34+ const details = parseDetails ( $item )
3435 programs . push ( {
3536 title : parseTitle ( $item ) ,
36- description : parseDescription ( $item ) ,
37+ subTitle : details . subTitle ,
38+ description : details . description ,
3739 image : parseImage ( $item ) ,
3840 start,
3941 stop
@@ -80,8 +82,20 @@ function parseTitle($item) {
8082 return $item . find ( 'h3 > a' ) . text ( ) . trim ( )
8183}
8284
83- function parseDescription ( $item ) {
84- return $item . find ( 'div.progentrylong' ) . text ( ) . trim ( )
85+ function parseDetails ( $item ) {
86+ const details = $item . find ( 'div.progentrylong' ) . html ( ) . split ( '<br>' ) . filter ( Boolean )
87+
88+ if ( details . length === 1 )
89+ return {
90+ description : details [ 0 ]
91+ }
92+
93+ const [ subTitle , description ] = details
94+
95+ return {
96+ subTitle,
97+ description
98+ }
8599}
86100
87101function parseStart ( $item ) {
You can’t perform that action at this time.
0 commit comments