forked from Ivasoft/mattermost-mobile
* Initial attempt at search highlighting for Markdown * Remove fonts from highlighted text so that it can be bolded * Add initial task list support * Render markdown checkbox * Switch to Commonmark fork * Use searchPatterns prop * searchPatterns prop at post level * Update app/components/markdown/transform.ts Co-authored-by: Jason Frerich <jason.frerich@mattermost.com> Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com> Co-authored-by: Jason Frerich <jason.frerich@mattermost.com>
58 lines
1.1 KiB
TypeScript
58 lines
1.1 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {TextStyle, ViewStyle} from 'react-native';
|
|
|
|
export type SearchPattern = {
|
|
pattern: RegExp;
|
|
term: string;
|
|
};
|
|
|
|
export type UserMentionKey = {
|
|
key: string;
|
|
caseSensitive?: boolean;
|
|
};
|
|
|
|
export type MarkdownBlockStyles = {
|
|
adjacentParagraph: ViewStyle;
|
|
horizontalRule: ViewStyle;
|
|
quoteBlockIcon: TextStyle;
|
|
};
|
|
|
|
export type MarkdownTextStyles = {
|
|
[key: string]: TextStyle;
|
|
};
|
|
|
|
export type MarkdownAtMentionRenderer = {
|
|
context: string[];
|
|
mentionName: string;
|
|
}
|
|
|
|
export type MarkdownBaseRenderer = {
|
|
context: string[];
|
|
literal: string;
|
|
}
|
|
|
|
export type MarkdownChannelMentionRenderer = {
|
|
context: string[];
|
|
channelName: string;
|
|
}
|
|
|
|
export type MarkdownEmojiRenderer = MarkdownBaseRenderer & {
|
|
emojiName: string;
|
|
}
|
|
|
|
export type MarkdownImageRenderer = {
|
|
linkDestination?: string;
|
|
context: string[];
|
|
src: string;
|
|
size?: {
|
|
width?: number;
|
|
height?: number;
|
|
};
|
|
}
|
|
|
|
export type MarkdownLatexRenderer = MarkdownBaseRenderer & {
|
|
latexCode: string;
|
|
}
|