Skip to content
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

feat: parse <plain> in parseSimple #146

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Changes from all commits
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
1 change: 1 addition & 0 deletions src/internal/parser.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as M from '..';

Check failure on line 1 in src/internal/parser.ts

View workflow job for this annotation

GitHub Actions / report

Type '(r: ParserTable<TypeTable>) => Parser<string | MfmUnicodeEmoji | MfmEmojiCode | MfmPlain>' is not assignable to type '(r: ParserTable<TypeTable>) => Parser<string | MfmSimpleNode>'.

Check failure on line 1 in src/internal/parser.ts

View workflow job for this annotation

GitHub Actions / test (16.10.0)

Type '(r: ParserTable<TypeTable>) => Parser<string | MfmUnicodeEmoji | MfmEmojiCode | MfmPlain>' is not assignable to type '(r: ParserTable<TypeTable>) => Parser<string | MfmSimpleNode>'.
import * as P from './core';
import { mergeText } from './util';
import { SeqParseResult } from './core';
Expand All @@ -7,7 +7,7 @@
// tsdのテストでファイルを追加しているにも関わらず「@twemoji/parser/dist/lib/regex」の型定義ファイルがないとエラーが出るため、
// このエラーを無視する。
/* eslint @typescript-eslint/ban-ts-comment: 1 */
// @ts-ignore

Check warning on line 10 in src/internal/parser.ts

View workflow job for this annotation

GitHub Actions / lint

Use "@ts-expect-error" instead of "@ts-ignore", as "@ts-ignore" will do nothing if the following line is error-free
import twemojiRegex from '@twemoji/parser/dist/lib/regex';

type ArgPair = { k: string, v: string | true };
Expand Down Expand Up @@ -170,6 +170,7 @@
return P.alt([
r.unicodeEmoji, // Regexp
r.emojiCode, // ":"
r.plainTag, // "<plain>" // to NOT parse emojiCode inside `<plain>`
r.text,
]);
},
Expand Down
Loading