Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
{/if}
</span>
{:else if node.type === MarkupNodeType.paragraph}
<p class="p-inline contrast" class:overflow-label={preview}>
<p class="p-inline contrast" class:overflow-label={preview} dir="auto">
{#if nodes.length > 0}
{#each nodes as node}
<Node {parseEmojisFunction} {node} {preview} singleTextNode={singleTextNode && nodes.length === 1} />
Expand All @@ -132,7 +132,7 @@
{:else if node.type === MarkupNodeType.heading}
{@const level = toNumber(node.attrs?.level) ?? 1}
{@const element = `h${level}`}
<svelte:element this={element}>
<svelte:element this={element} dir="auto">
{#if nodes.length > 0}
{#each nodes as node}
<Node {node} {preview} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@
{/each}
{/if}
{:else if node.type === MarkupNodeType.paragraph}
<p class="p-inline" class:overflow-label={true} style:margin="0" class:contrast={!colorInherit} class:colorInherit>
<p
class="p-inline"
class:overflow-label={true}
style:margin="0"
class:contrast={!colorInherit}
class:colorInherit
dir="auto"
>
<LiteNodes {nodes} {parseEmojisFunction} {colorInherit} />
</p>
{:else if node.type === MarkupNodeType.blockquote}
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/styles/prose.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ table.proseTable {
}

th {
text-align: left;
text-align: start;
background-color: var(--text-editor-table-header-color);
}

Expand Down
7 changes: 7 additions & 0 deletions plugins/text-editor-resources/src/kits/editor-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import {
extensionKit,
mergeKitOptions,
TextColorStylingKit,
Heading,
Highlight,
Paragraph,
Subscript,
Superscript
} from '@hcengineering/text'
Expand Down Expand Up @@ -89,6 +91,11 @@ const StaticEditorKit = extensionKit(
({
...CommonKitFactory(e),

// Let each text block take its direction from its first strong character,
// so RTL and mixed RTL/LTR text is rendered correctly (client-side only, stored content is unchanged)
paragraph: e(Paragraph, { HTMLAttributes: { dir: 'auto' } }),
heading: e(Heading, { HTMLAttributes: { dir: 'auto' } }),

shortcuts: e(subKits.shortcuts, context), // needs to be loaded as early as possible to override the default behavior

// ===========================================================================================
Expand Down
Loading