Skip to content

Commit 27ce5d5

Browse files
authored
Merge branch '@ksienkiewicz/docs-fundamentals' into @ksienkiewicz/docs-rich-text-formatting
2 parents da510a4 + 32e2b6a commit 27ce5d5

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

docs/docs/fundamentals/core-concepts.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ does and help you understand further chapters better.
1414
every keystroke back into React state. It owns its content on the native side
1515
and you talk to it through a `ref`.
1616

17-
This is deliberate. Rich text changes constantly every character, selection
18-
move and style toggle and round-tripping all of that through JavaScript state
17+
This is deliberate. Rich text changes constantly - every character, selection
18+
move and style toggle - and round-tripping all of that through JavaScript state
1919
would be extremely slow and open to a possible de-synchronization of those states.
2020
Keeping it native makes the editor fast and stable.
2121

@@ -56,8 +56,8 @@ All supported and canonical tags are listed in [Supported tags](/fundamentals/ht
5656

5757
The library is split into an editor and a viewer:
5858

59-
- **`EnrichedTextInput`** the interactive editor from the previous page.
60-
- **`EnrichedText`** a read-only display component that renders the input's
59+
- **`EnrichedTextInput`** - the interactive editor from the previous page.
60+
- **`EnrichedText`** - a read-only display component that renders the input's
6161
HTML.
6262

6363
The HTML format that both components expect is identical, what allows you to integrate them seamlessly. A common setup edits in `EnrichedTextInput`, stores the `getHTML` output, and later displays it with `EnrichedText`.
@@ -66,12 +66,12 @@ The HTML format that both components expect is identical, what allows you to int
6666

6767
Not every style can be combined with every other. For example, a paragraph can't be both a heading and a list item, code blocks don't support inline formatting such as bold or italic. The editor tracks this and reports it through `onChangeState`, which gives each style three booleans:
6868

69-
- **`isActive`** the style is applied at the current selection. Use it to
69+
- **`isActive`** - the style is applied at the current selection. Use it to
7070
highlight a toolbar button.
71-
- **`isBlocking`** another active style forbids this one entirely, so toggling
71+
- **`isBlocking`** - another active style forbids this one entirely, so toggling
7272
it would do nothing. For example bold is blocked inside a code block. Use it
7373
to disable a button.
74-
- **`isConflicting`** this style would replace an active one if toggled on.
74+
- **`isConflicting`** - this style would replace an active one if toggled on.
7575
For example switching a blockquote paragraph to a heading removes the
7676
blockquote. Use it to hint that the toggle is a swap, not an addition.
7777

docs/docs/fundamentals/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ React Native Enriched HTML is a rich text solution for React Native built by
1919

2020
It ships two fully native components: `EnrichedTextInput`, a rich text editor
2121
that styles text live as you type, and `EnrichedText`, a read-only display component that
22-
renders the input's output. Both speak HTML the input
22+
renders the input's output. Both speak HTML - the input
2323
produces it, the display consumes it.
2424

2525
Not only does this library allow you to apply basic rich text styles you know well,

docs/docs/fundamentals/html-format-and-supported-tags.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ sidebar_position: 4
44

55
# HTML format and supported tags
66

7-
The editor works with a fixed set of standard and custom HTML tags it both
7+
The editor works with a fixed set of standard and custom HTML tags - it both
88
produces them in its output and accepts them as input. This page is the
99
reference for that set.
1010

1111
Styles fall into two groups: **inline** tags that wrap a range of characters,
1212
and **paragraph** tags that apply to whole lines. Not all of them combine
1313
freely, and there are two kinds of restriction:
1414

15-
- **Conflicting** toggling a style that conflicts with an active one replaces
15+
- **Conflicting** - toggling a style that conflicts with an active one replaces
1616
it. Toggling `<h2>` on a `<blockquote>` paragraph removes the blockquote and
1717
applies the heading.
18-
- **Blocking** a blocked style can't be toggled at all while the blocking
18+
- **Blocking** - a blocked style can't be toggled at all while the blocking
1919
style is active. `<b>` is blocked inside `<codeblock>`, so bold can't be
2020
applied there.
2121

@@ -45,7 +45,7 @@ of it is redundant and therefore blocked.
4545

4646
## Paragraph tags
4747

48-
Only one paragraph-level style can be active per paragraph they all conflict
48+
Only one paragraph-level style can be active per paragraph - they all conflict
4949
with each other.
5050

5151
Some paragraph styles are containers that wrap each line inside them with an

docs/docs/fundamentals/your-first-editor.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ the library: **calling methods on the input** and **reading its state back**.
1515
## Rendering the input
1616

1717
Start by dropping an `EnrichedTextInput` on the screen. It behaves like a
18-
regular `TextInput` give it a `style` and a `placeholder` and you have a
18+
regular `TextInput` - give it a `style` and a `placeholder` and you have a
1919
working editor.
2020

2121
```tsx
@@ -48,7 +48,7 @@ const styles = StyleSheet.create({
4848

4949
## Toggling a style
5050

51-
The input is uncontrolled you don't change its content through props. Instead
51+
The input is uncontrolled - you don't change its content through props. Instead
5252
you call methods on it through a `ref` of type `EnrichedTextInputInstance`.
5353

5454
Add a ref and a button that calls `toggleBold`. Each call flips bold on the
@@ -103,7 +103,7 @@ const styles = StyleSheet.create({
103103
});
104104
```
105105

106-
Every other style is toggled similarly via `ref` there's a `toggleItalic`,
106+
Every other style is toggled similarly via `ref` - there's a `toggleItalic`,
107107
`toggleUnderline`, `toggleH1`, `toggleOrderedList`, and so on.
108108

109109
## Reading the state back
@@ -194,7 +194,7 @@ lists which styles clash with each other.
194194

195195
## Try it out
196196

197-
Here's that editor running live on this page. Select some text and hit **Bold**
197+
Here's that editor running live on this page. Select some text and hit **Bold** -
198198
notice the button turns green whenever the cursor sits on bold text. Switch to
199199
the **Code** tab to see the exact source.
200200

0 commit comments

Comments
 (0)