mirror of
https://github.com/standardnotes/app.git
synced 2026-01-16 23:01:30 +00:00
Merge 2ed468a7dc into 5944cead98
This commit is contained in:
commit
d54c88e68d
1 changed files with 40 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ import {
|
|||
$createHorizontalRuleNode,
|
||||
$isHorizontalRuleNode,
|
||||
} from '@lexical/react/LexicalHorizontalRuleNode'
|
||||
import { $isParagraphNode, $isTextNode, LexicalNode } from 'lexical'
|
||||
import { $isParagraphNode, $isTextNode, LexicalNode, $createTextNode } from 'lexical'
|
||||
import {
|
||||
$createRemoteImageNode,
|
||||
$isRemoteImageNode,
|
||||
|
|
@ -74,6 +74,42 @@ const IMAGE: TextMatchTransformer = {
|
|||
type: 'text-match',
|
||||
}
|
||||
|
||||
export const ARROW_DOUBLE: TextMatchTransformer = {
|
||||
dependencies: [],
|
||||
export: () => null,
|
||||
importRegExp: /<-> /,
|
||||
regExp: /<-> $/,
|
||||
replace: (textNode) => {
|
||||
textNode.replace($createTextNode('↔ '))
|
||||
},
|
||||
trigger: ' ',
|
||||
type: 'text-match',
|
||||
}
|
||||
|
||||
export const ARROW_RIGHT: TextMatchTransformer = {
|
||||
dependencies: [],
|
||||
export: () => null,
|
||||
importRegExp: /-> /,
|
||||
regExp: /-> $/,
|
||||
replace: (textNode) => {
|
||||
textNode.replace($createTextNode('→ '))
|
||||
},
|
||||
trigger: ' ',
|
||||
type: 'text-match',
|
||||
}
|
||||
|
||||
export const ARROW_LEFT: TextMatchTransformer = {
|
||||
dependencies: [],
|
||||
export: () => null,
|
||||
importRegExp: /<- /,
|
||||
regExp: /<- $/,
|
||||
replace: (textNode) => {
|
||||
textNode.replace($createTextNode('← '))
|
||||
},
|
||||
trigger: ' ',
|
||||
type: 'text-match',
|
||||
}
|
||||
|
||||
const INLINE_FILE: TextMatchTransformer = {
|
||||
dependencies: [InlineFileNode],
|
||||
export: (node) => {
|
||||
|
|
@ -247,6 +283,9 @@ export const MarkdownTransformers = [
|
|||
CHECK_LIST,
|
||||
IMAGE,
|
||||
INLINE_FILE,
|
||||
ARROW_DOUBLE,
|
||||
ARROW_RIGHT,
|
||||
ARROW_LEFT,
|
||||
...ELEMENT_TRANSFORMERS,
|
||||
...MULTILINE_ELEMENT_TRANSFORMERS,
|
||||
...TEXT_FORMAT_TRANSFORMERS,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue