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 @@ -22,9 +22,9 @@ export function parseMdContent (md: string): TutorialFrame | never {
2222
2323 const lines = md . split ( '\n' )
2424
25- // Split the multiple parts - This way enables the creator to use 4/5 level headers inside the content.
25+ // Split the header based sections
2626 lines . forEach ( ( line , index ) => {
27- if ( line . match ( / # { 1 , 3 } \s / ) || index === lines . length - 1 ) {
27+ if ( line . match ( / ^ # { 1 , 5 } \s / ) || index === lines . length - 1 ) {
2828 if ( start !== - 1 ) {
2929 parts . push ( lines . slice ( start , index ) . join ( '\n' ) )
3030 start = index
@@ -44,6 +44,7 @@ export function parseMdContent (md: string): TutorialFrame | never {
4444
4545 // Capture summary
4646 const summaryMatch = parts . shift ( ) . match ( R . summary )
47+
4748 if ( summaryMatch . groups . tutorialTitle ) {
4849 mdContent . summary . title = summaryMatch . groups . tutorialTitle . trim ( )
4950 }
@@ -57,7 +58,6 @@ export function parseMdContent (md: string): TutorialFrame | never {
5758 parts . forEach ( ( section : string ) => {
5859 // match level
5960 const levelMatch : RegExpMatchArray | null = section . match ( R . level )
60-
6161 if ( levelMatch && levelMatch . groups ) {
6262 const levelId = levelMatch . groups . levelId . replace ( '.' , '' )
6363 current = {
You can’t perform that action at this time.
0 commit comments