mirror of
https://activitypub.software/TransFem-org/sfm-js
synced 2024-11-22 14:05:13 +00:00
tweak fn parsing
This commit is contained in:
parent
f916d5bd8f
commit
08cb023e9d
2 changed files with 11 additions and 1 deletions
|
@ -450,7 +450,7 @@ export const language = P.createLanguage({
|
||||||
P.regexp(/[a-z0-9_]+/i),
|
P.regexp(/[a-z0-9_]+/i),
|
||||||
P.seq([
|
P.seq([
|
||||||
P.str('='),
|
P.str('='),
|
||||||
P.regexp(/[a-z0-9_.]+/i),
|
P.regexp(/[a-z0-9_.-]+/i),
|
||||||
], 1).option(),
|
], 1).option(),
|
||||||
]).map(result => {
|
]).map(result => {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1199,6 +1199,16 @@ hoge`;
|
||||||
assert.deepStrictEqual(mfm.parse(input), output);
|
assert.deepStrictEqual(mfm.parse(input), output);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('with a string argument 2', () => {
|
||||||
|
const input = '$[position.x=-3 a]';
|
||||||
|
const output = [
|
||||||
|
FN('position', { x: '-3' }, [
|
||||||
|
TEXT('a')
|
||||||
|
])
|
||||||
|
];
|
||||||
|
assert.deepStrictEqual(mfm.parse(input), output);
|
||||||
|
});
|
||||||
|
|
||||||
it('invalid fn name', () => {
|
it('invalid fn name', () => {
|
||||||
const input = '$[関数 text]';
|
const input = '$[関数 text]';
|
||||||
const output = [
|
const output = [
|
||||||
|
|
Loading…
Reference in a new issue