mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
Markdown issues (#747)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
275b2b0800
commit
b0908ec251
@ -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'}
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user