Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc457a8

Browse files
committed
resolve issue with no empty spaces at end
Signed-off-by: shmck <shawn.j.mckay@gmail.com>
1 parentb547186 commitdc457a8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

‎src/utils/parse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ type ParseParams = {
141141
};
142142

143143
exportfunctionparse(params:ParseParams):any{
144-
constmdContent:TutorialFrame=parseMdContent(params.text);
144+
constmdContent:TutorialFrame=parseMdContent(params.text+"\n\n");
145145

146146
constparsed:Partial<T.Tutorial>={
147147
version:params.skeleton.version,

‎tests/parse.test.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ The first step
11891189
expect(result.levels).toEqual(expected.levels);
11901190
});
11911191

1192-
it("should parsea single hint",()=>{
1192+
it("should parsewithout spaces at the end",()=>{
11931193
constmd=`# Title
11941194
11951195
Description.
@@ -1204,9 +1204,7 @@ The first step
12041204
12051205
#### HINTS
12061206
1207-
- A test with a \`backtick\`
1208-
1209-
`;
1207+
- A test with a \`backtick\``;
12101208
constskeleton={
12111209
levels:[
12121210
{
@@ -1222,9 +1220,7 @@ The first step
12221220
constresult=parse({
12231221
text:md,
12241222
skeleton,
1225-
commits:{
1226-
"1.1:T":["abcdef1","123456789"],
1227-
},
1223+
commits:{},
12281224
});
12291225
constexpected={
12301226
summary:{
@@ -1241,7 +1237,7 @@ The first step
12411237
id:"1.1",
12421238
content:"The first step",
12431239
setup:{
1244-
commits:["abcdef1","123456789"],
1240+
commits:[],
12451241
},
12461242
hints:["A test with a `backtick`"],
12471243
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp