Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sfm-js
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dakkar
sfm-js
Commits
b12feb09
Commit
b12feb09
authored
3 years ago
by
marihachi
Browse files
Options
Downloads
Patches
Plain Diff
update test utility
parent
fbaeed93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/node.ts
+21
-23
21 additions, 23 deletions
test/node.ts
with
21 additions
and
23 deletions
test/node.ts
+
21
−
23
View file @
b12feb09
import
{
MfmBold
,
MfmCenter
,
MfmCodeBlock
,
MfmEmojiCode
,
MfmFn
,
MfmHashtag
,
MfmInline
,
MfmInlineCode
,
MfmItalic
,
MfmLink
,
MfmMathBlock
,
MfmMathInline
,
MfmMention
,
MfmNode
,
MfmQuote
,
MfmSearch
,
MfmSmall
,
MfmStrike
,
MfmText
,
MfmUnicodeEmoji
,
MfmUrl
MfmFn
,
MfmInline
,
MfmNode
,
NodeType
}
from
'
../built
'
;
export
const
QUOTE
=
(
children
:
MfmNode
[]):
NodeType
<
'
quote
'
>
=>
{
return
{
type
:
'
quote
'
,
children
};
};
export
const
SEARCH
=
(
query
:
string
,
content
:
string
):
NodeType
<
'
search
'
>
=>
{
return
{
type
:
'
search
'
,
props
:
{
query
,
content
}
};
};
export
const
CODE_BLOCK
=
(
code
:
string
,
lang
:
string
|
null
):
NodeType
<
'
blockCode
'
>
=>
{
return
{
type
:
'
blockCode
'
,
props
:
{
code
,
lang
}
};
};
export
const
MATH_BLOCK
=
(
formula
:
string
):
NodeType
<
'
mathBlock
'
>
=>
{
return
{
type
:
'
mathBlock
'
,
props
:
{
formula
}
};
};
export
const
CENTER
=
(
children
:
MfmInline
[]):
NodeType
<
'
center
'
>
=>
{
return
{
type
:
'
center
'
,
children
};
};
export
const
QUOTE
=
(
children
:
MfmNode
[]):
MfmQuote
=>
{
return
{
type
:
'
quote
'
,
children
};
};
export
const
SEARCH
=
(
query
:
string
,
content
:
string
):
MfmSearch
=>
{
return
{
type
:
'
search
'
,
props
:
{
query
,
content
}
};
};
export
const
CODE_BLOCK
=
(
code
:
string
,
lang
:
string
|
null
):
MfmCodeBlock
=>
{
return
{
type
:
'
blockCode
'
,
props
:
{
code
,
lang
}
};
};
export
const
MATH_BLOCK
=
(
formula
:
string
):
MfmMathBlock
=>
{
return
{
type
:
'
mathBlock
'
,
props
:
{
formula
}
};
};
export
const
CENTER
=
(
children
:
MfmInline
[]):
MfmCenter
=>
{
return
{
type
:
'
center
'
,
children
};
};
export
const
BOLD
=
(
children
:
MfmInline
[]):
MfmBold
=>
{
return
{
type
:
'
bold
'
,
children
};
};
export
const
SMALL
=
(
children
:
MfmInline
[]):
MfmSmall
=>
{
return
{
type
:
'
small
'
,
children
};
};
export
const
ITALIC
=
(
children
:
MfmInline
[]):
MfmItalic
=>
{
return
{
type
:
'
italic
'
,
children
};
};
export
const
STRIKE
=
(
children
:
MfmInline
[]):
MfmStrike
=>
{
return
{
type
:
'
strike
'
,
children
};
};
export
const
INLINE_CODE
=
(
code
:
string
):
MfmInlineCode
=>
{
return
{
type
:
'
inlineCode
'
,
props
:
{
code
}
};
};
export
const
MATH_INLINE
=
(
formula
:
string
):
MfmMathInline
=>
{
return
{
type
:
'
mathInline
'
,
props
:
{
formula
}
};
};
export
const
MENTION
=
(
username
:
string
,
host
:
string
|
null
,
acct
:
string
):
MfmMention
=>
{
return
{
type
:
'
mention
'
,
props
:
{
username
,
host
,
acct
}
};
};
export
const
HASHTAG
=
(
value
:
string
):
MfmHashtag
=>
{
return
{
type
:
'
hashtag
'
,
props
:
{
hashtag
:
value
}
};
};
export
const
N_URL
=
(
value
:
string
):
MfmUrl
=>
{
return
{
type
:
'
url
'
,
props
:
{
url
:
value
}
};
};
export
const
LINK
=
(
silent
:
boolean
,
url
:
string
,
children
:
MfmInline
[]):
MfmLink
=>
{
return
{
type
:
'
link
'
,
props
:
{
silent
,
url
},
children
};
};
export
const
EMOJI_CODE
=
(
name
:
string
):
MfmEmojiCode
=>
{
return
{
type
:
'
emojiCode
'
,
props
:
{
name
:
name
}
};
};
export
const
FN
=
(
name
:
string
,
args
:
MfmFn
[
'
props
'
][
'
args
'
],
children
:
MfmFn
[
'
children
'
]):
MfmFn
=>
{
return
{
type
:
'
fn
'
,
props
:
{
name
,
args
},
children
};
};
export
const
UNI_EMOJI
=
(
value
:
string
):
MfmUnicodeEmoji
=>
{
return
{
type
:
'
unicodeEmoji
'
,
props
:
{
emoji
:
value
}
};
};
export
const
TEXT
=
(
value
:
string
):
MfmText
=>
{
return
{
type
:
'
text
'
,
props
:
{
text
:
value
}
};
};
export
const
BOLD
=
(
children
:
MfmInline
[]):
NodeType
<
'
bold
'
>
=>
{
return
{
type
:
'
bold
'
,
children
};
};
export
const
SMALL
=
(
children
:
MfmInline
[]):
NodeType
<
'
small
'
>
=>
{
return
{
type
:
'
small
'
,
children
};
};
export
const
ITALIC
=
(
children
:
MfmInline
[]):
NodeType
<
'
italic
'
>
=>
{
return
{
type
:
'
italic
'
,
children
};
};
export
const
STRIKE
=
(
children
:
MfmInline
[]):
NodeType
<
'
strike
'
>
=>
{
return
{
type
:
'
strike
'
,
children
};
};
export
const
INLINE_CODE
=
(
code
:
string
):
NodeType
<
'
inlineCode
'
>
=>
{
return
{
type
:
'
inlineCode
'
,
props
:
{
code
}
};
};
export
const
MATH_INLINE
=
(
formula
:
string
):
NodeType
<
'
mathInline
'
>
=>
{
return
{
type
:
'
mathInline
'
,
props
:
{
formula
}
};
};
export
const
MENTION
=
(
username
:
string
,
host
:
string
|
null
,
acct
:
string
):
NodeType
<
'
mention
'
>
=>
{
return
{
type
:
'
mention
'
,
props
:
{
username
,
host
,
acct
}
};
};
export
const
HASHTAG
=
(
value
:
string
):
NodeType
<
'
hashtag
'
>
=>
{
return
{
type
:
'
hashtag
'
,
props
:
{
hashtag
:
value
}
};
};
export
const
N_URL
=
(
value
:
string
):
NodeType
<
'
url
'
>
=>
{
return
{
type
:
'
url
'
,
props
:
{
url
:
value
}
};
};
export
const
LINK
=
(
silent
:
boolean
,
url
:
string
,
children
:
MfmInline
[]):
NodeType
<
'
link
'
>
=>
{
return
{
type
:
'
link
'
,
props
:
{
silent
,
url
},
children
};
};
export
const
EMOJI_CODE
=
(
name
:
string
):
NodeType
<
'
emojiCode
'
>
=>
{
return
{
type
:
'
emojiCode
'
,
props
:
{
name
:
name
}
};
};
export
const
FN
=
(
name
:
string
,
args
:
MfmFn
[
'
props
'
][
'
args
'
],
children
:
MfmFn
[
'
children
'
]):
NodeType
<
'
fn
'
>
=>
{
return
{
type
:
'
fn
'
,
props
:
{
name
,
args
},
children
};
};
export
const
UNI_EMOJI
=
(
value
:
string
):
NodeType
<
'
unicodeEmoji
'
>
=>
{
return
{
type
:
'
unicodeEmoji
'
,
props
:
{
emoji
:
value
}
};
};
export
const
TEXT
=
(
value
:
string
):
NodeType
<
'
text
'
>
=>
{
return
{
type
:
'
text
'
,
props
:
{
text
:
value
}
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment