Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature/test output #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 31, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
cleanup title/description parsing
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed May 31, 2020
commit d2e1097c1e95ddcd18abe5b46015cf240b506aa4
10 changes: 4 additions & 6 deletions src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ export function parseMdContent(md: string): TutorialFrame | never {
const summaryMatch = parts
.shift()
.match(/^#\s(?<tutorialTitle>.*)[\n\r]+(?<tutorialDescription>[^]*)/);
if (!summaryMatch.groups.tutorialTitle) {
throw new Error("Missing tutorial title");
if (summaryMatch.groups.tutorialTitle) {
mdContent.summary.title = summaryMatch.groups.tutorialTitle.trim();
}
mdContent.summary.title = summaryMatch.groups.tutorialTitle.trim();

if (!summaryMatch.groups.tutorialDescription) {
throw new Error("Missing tutorial summary description");
if (summaryMatch.groups.tutorialDescription) {
mdContent.summary.description = summaryMatch.groups.tutorialDescription.trim();
}
mdContent.summary.description = summaryMatch.groups.tutorialDescription.trim();

// Identify each part of the content
parts.forEach((section: string) => {
Expand Down