Markdown issues (#747)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2021-12-30 15:10:13 +06:00 committed by GitHub
parent 275b2b0800
commit b0908ec251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 2 deletions

View File

@ -35,6 +35,8 @@
<blockquote><svelte:self nodes={node.childNodes}/></blockquote>
{:else if node.nodeName === 'CODE'}
<code><svelte:self nodes={node.childNodes}/></code>
{:else if node.nodeName === 'PRE'}
<pre><svelte:self nodes={node.childNodes}/></pre>
{:else if node.nodeName === 'BR'}
<br/>
{:else if node.nodeName === 'HR'}
@ -45,6 +47,12 @@
<h2><svelte:self nodes={node.childNodes}/></h2>
{:else if node.nodeName === 'H3'}
<h3><svelte:self nodes={node.childNodes}/></h3>
{:else if node.nodeName === 'H4'}
<h4><svelte:self nodes={node.childNodes}/></h4>
{:else if node.nodeName === 'H5'}
<h5><svelte:self nodes={node.childNodes}/></h5>
{:else if node.nodeName === 'H6'}
<h6><svelte:self nodes={node.childNodes}/></h6>
{:else if node.nodeName === 'UL'}
<ul><svelte:self nodes={node.childNodes}/></ul>
{:else if node.nodeName === 'OL'}

View File

@ -51,9 +51,21 @@ export function clear (): void {
editor.commands.clearContent(false)
}
const HandleEnter = Extension.create({
const Handle = Extension.create({
addKeyboardShortcuts() {
return {
'Shift-Enter': () => {
const res = this.editor.commands.splitListItem('listItem')
if (!res) {
this.editor.commands.first(({ commands }) => [
() => commands.newlineInCode(),
() => commands.createParagraphNear(),
() => commands.liftEmptyBlock(),
() => commands.splitBlock(),
])
}
return true
},
'Enter': () => {
submit()
return true
@ -67,10 +79,10 @@ onMount(() => {
element,
content: content,
extensions: [
HandleEnter,
StarterKit,
Highlight,
Link,
Handle, // order important
// Typography, // we need to disable 1/2 -> ½ rule (https://github.com/hcengineering/anticrm/issues/345)
Placeholder.configure({placeholder: placeholder}),
Mention.configure({