File tree 1 file changed +3
-3
lines changed
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 {
22
22
23
23
const lines = md . split ( '\n' )
24
24
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
26
26
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 ) {
28
28
if ( start !== - 1 ) {
29
29
parts . push ( lines . slice ( start , index ) . join ( '\n' ) )
30
30
start = index
@@ -44,6 +44,7 @@ export function parseMdContent (md: string): TutorialFrame | never {
44
44
45
45
// Capture summary
46
46
const summaryMatch = parts . shift ( ) . match ( R . summary )
47
+
47
48
if ( summaryMatch . groups . tutorialTitle ) {
48
49
mdContent . summary . title = summaryMatch . groups . tutorialTitle . trim ( )
49
50
}
@@ -57,7 +58,6 @@ export function parseMdContent (md: string): TutorialFrame | never {
57
58
parts . forEach ( ( section : string ) => {
58
59
// match level
59
60
const levelMatch : RegExpMatchArray | null = section . match ( R . level )
60
-
61
61
if ( levelMatch && levelMatch . groups ) {
62
62
const levelId = levelMatch . groups . levelId . replace ( '.' , '' )
63
63
current = {
You can’t perform that action at this time.
0 commit comments