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

Skip to content

setup single hint #74

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
Oct 9, 2020
Merged
Show file tree
Hide file tree
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
Next Next commit
resolve issue with no empty spaces at end
Signed-off-by: shmck <[email protected]>
  • Loading branch information
ShMcK committed Oct 9, 2020
commit dc457a8f2b0b57323264656f8f6a05f89f067d94
2 changes: 1 addition & 1 deletion src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ type ParseParams = {
};

export function parse(params: ParseParams): any {
const mdContent: TutorialFrame = parseMdContent(params.text);
const mdContent: TutorialFrame = parseMdContent(params.text + "\n\n");

const parsed: Partial<T.Tutorial> = {
version: params.skeleton.version,
Expand Down
12 changes: 4 additions & 8 deletions tests/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ The first step
expect(result.levels).toEqual(expected.levels);
});

it("should parse a single hint", () => {
it("should parse without spaces at the end", () => {
const md = `# Title

Description.
Expand All @@ -1204,9 +1204,7 @@ The first step

#### HINTS

- A test with a \`backtick\`

`;
- A test with a \`backtick\``;
const skeleton = {
levels: [
{
Expand All @@ -1222,9 +1220,7 @@ The first step
const result = parse({
text: md,
skeleton,
commits: {
"1.1:T": ["abcdef1", "123456789"],
},
commits: {},
});
const expected = {
summary: {
Expand All @@ -1241,7 +1237,7 @@ The first step
id: "1.1",
content: "The first step",
setup: {
commits: ["abcdef1", "123456789"],
commits: [],
},
hints: ["A test with a `backtick`"],
},
Expand Down