Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
marihachi committed Jun 9, 2021
2 parents b31a705 + 07f6d94 commit 2926855
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mfm-js",
"version": "0.17.0",
"version": "0.18.0",
"description": "An MFM parser implementation with PEG.js",
"main": "./built/index.js",
"types": "./built/index.d.ts",
Expand Down Expand Up @@ -31,7 +31,7 @@
"typescript": "4.2.x"
},
"dependencies": {
"twemoji-parser": "13.0.x"
"twemoji-parser": "13.1.x"
},
"files": [
"built"
Expand Down
20 changes: 17 additions & 3 deletions test/parser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert';
import * as mfm from '../built/index';
import {
TEXT, CENTER, FN, UNI_EMOJI, MENTION, EMOJI_CODE, HASHTAG, N_URL, BOLD, SMALL, ITALIC, STRIKE, QUOTE, MATH_BLOCK, SEARCH, CODE_BLOCK, LINK, INLINE_CODE
TEXT, CENTER, FN, UNI_EMOJI, MENTION, EMOJI_CODE, HASHTAG, N_URL, BOLD, SMALL, ITALIC, STRIKE, QUOTE, MATH_BLOCK, SEARCH, CODE_BLOCK, LINK, INLINE_CODE, MATH_INLINE
} from '../built/index';

describe('PlainParser', () => {
Expand Down Expand Up @@ -542,7 +542,15 @@ describe('FullParser', () => {
});
});

// strike
describe('strike', () => {
it('basic', () => {
const input = '~~foo~~';
const output = [STRIKE([
TEXT('foo')
])];
assert.deepStrictEqual(mfm.parse(input), output);
});
});

describe('inlineCode', () => {
it('basic', () => {
Expand All @@ -564,7 +572,13 @@ describe('FullParser', () => {
});
});

// mathInline
describe('mathInline', () => {
it('basic', () => {
const input = '\\(x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}\\)';
const output = [MATH_INLINE('x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}')];
assert.deepStrictEqual(mfm.parse(input), output);
});
});

describe('mention', () => {
it('basic', () => {
Expand Down

0 comments on commit 2926855

Please sign in to comment.