Skip to content

Commit 9319b7f

Browse files
authored
Readme typos and bad formatting fixes (#144)
1 parent 0889a54 commit 9319b7f

1 file changed

Lines changed: 79 additions & 79 deletions

File tree

README.md

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ If the selection spans more than one paragraph, logically more of them will be a
164164

165165
## Links
166166

167-
The links are here, just like in any other editor, a piece of text with a URL attribtued to it. They can be added in two ways: automatically or manually.
167+
The links are here, just like in any other editor, a piece of text with a URL attributed to it. They can be added in two ways: automatically or manually.
168168

169169
### Automatic links detection
170170

@@ -224,7 +224,7 @@ You can find some examples in the [usage section](#usage) or in the example app.
224224
`react-native-enriched` emits a few more events that may be of use:
225225

226226
- [onFocus](#onfocus) - emits whenever input focuses.
227-
- [onBlur](#onblur) - emits whenver input blurs.
227+
- [onBlur](#onblur) - emits whenever input blurs.
228228
- [onChangeText](#onchangetext) - returns the input's text anytime it changes.
229229
- [onChangeHtml](#onchangehtml) - returns HTML string parsed from current input text and styles anytime it would change. As parsing the HTML on each input change is a pretty expensive operation, not assigning the event's callback will speed up iOS input a bit. We are considering adding some API to improve it, see [future plans](#future-plans).
230230
- [onChangeSelection](#onchangeselection) - returns all the data needed for working with selections (as of now it's mainly useful for [links](#links)).
@@ -243,9 +243,9 @@ You can find some examples in the [usage section](#usage) or in the example app.
243243

244244
If `true`, focuses the input.
245245

246-
| Type | Default Value | Platform |
247-
| ---- | ------------- | -------- |
248-
| `bool` | `false` | Both |
246+
| Type | Default Value | Platform |
247+
|--------|---------------|----------|
248+
| `bool` | `false` | Both |
249249

250250
#### `autoCapitalize`
251251

@@ -256,57 +256,57 @@ Tells input to automatically capitalize certain characters.
256256
- `sentences`: first letter of each sentence.
257257
- `none`: don't auto capitalize anything.
258258

259-
| Type | Default Value | Platform |
260-
| ---- | ------------- | -------- |
261-
| `'none' \| 'sentences' \| 'words' \| 'characters'` | `'sentences'` | Both |
259+
| Type | Default Value | Platform |
260+
|----------------------------------------------------|---------------|----------|
261+
| `'none' \| 'sentences' \| 'words' \| 'characters'` | `'sentences'` | Both |
262262

263263
#### `cursorColor`
264264

265265
When provided it will set the color of the cursor (or "caret") in the component.
266266

267-
| Type | Default Value | Platform |
268-
| ---- | ------------- | -------- |
269-
| [`color`](https://reactnative.dev/docs/colors) | system default | Android |
267+
| Type | Default Value | Platform |
268+
|------------------------------------------------|----------------|----------|
269+
| [`color`](https://reactnative.dev/docs/colors) | system default | Android |
270270

271271
#### `defaultValue`
272272

273273
Provides an initial value for the input. If the string is a valid HTML output of the `EnrichedTextInput` component (or other HTML that the parser will accept), proper styles will be applied.
274274

275-
| Type | Default Value | Platform |
276-
| ---- | ------------- | -------- |
277-
| `string` | - | Both |
275+
| Type | Default Value | Platform |
276+
|----------|---------------|----------|
277+
| `string` | - | Both |
278278

279279
#### `editable`
280280

281281
If `false`, text is not editable.
282282

283-
| Type | Default Value | Platform |
284-
| ---- | ------------- | -------- |
285-
| `bool` | `true` | Both |
283+
| Type | Default Value | Platform |
284+
|--------|---------------|----------|
285+
| `bool` | `true` | Both |
286286

287287
#### `htmlStyle`
288288

289289
A prop for customizing styles' appearances.
290290

291-
| Type | Default Value | Platform |
292-
| ---- | ------------- | -------- |
293-
| [`HtmlStyle`](#htmlstyle-type) | default values from [`HtmlStyle`](#htmlstyle-type) | Both |
291+
| Type | Default Value | Platform |
292+
|--------------------------------|----------------------------------------------------|----------|
293+
| [`HtmlStyle`](#htmlstyle-type) | default values from [`HtmlStyle`](#htmlstyle-type) | Both |
294294

295295
#### `mentionIndicators`
296296

297297
The recognized mention indicators. Each item needs to be a 1 character long string.
298298

299-
| Type | Default Value | Platform |
300-
| ---- | ------------- | -------- |
301-
| array of `string` | `['@']` | Both |
299+
| Type | Default Value | Platform |
300+
|-------------------|---------------|----------|
301+
| array of `string` | `['@']` | Both |
302302

303303
#### `onBlur`
304304

305305
Callback that's called whenever the input loses focused (is blurred).
306306

307-
| Type | Default Value | Platform |
308-
| ---- | ------------- | -------- |
309-
| `() => void` | - | Both |
307+
| Type | Default Value | Platform |
308+
|--------------|---------------|----------|
309+
| `() => void` | - | Both |
310310

311311
#### `onChangeHtml`
312312

@@ -322,9 +322,9 @@ interface OnChangeHtmlEvent {
322322

323323
- `value` is the new HTML.
324324

325-
| Type | Default Value | Platform |
326-
| ---- | ------------- | -------- |
327-
| `(NativeSyntheticEvent\<OnChangeHtmlEvent>) => void` | - | Both |
325+
| Type | Default Value | Platform |
326+
|------------------------------------------------------|---------------|----------|
327+
| `(NativeSyntheticEvent\<OnChangeHtmlEvent>) => void` | - | Both |
328328

329329
#### `onChangeMention`
330330

@@ -342,9 +342,9 @@ interface OnChangeMentionEvent {
342342
- `indicator` is the indicator of the currently edited mention.
343343
- `text` contains whole text that has been typed after the indicator.
344344

345-
| Type | Default Value | Platform |
346-
| ---- | ------------- | -------- |
347-
| `(OnChangeMentionEvent) => void` | - | Both |
345+
| Type | Default Value | Platform |
346+
|----------------------------------|---------------|----------|
347+
| `(OnChangeMentionEvent) => void` | - | Both |
348348

349349
#### `onChangeSelection`
350350

@@ -364,9 +364,9 @@ OnChangeSelectionEvent {
364364
- `end` is the first index after the selection's ending. For just a cursor in place (no selection), `start` equals `end`.
365365
- `text` is the input's text in the current selection.
366366

367-
| Type | Default Value | Platform |
368-
| ---- | ------------- | -------- |
369-
| `(NativeSyntheticEvent\<OnChangeSelectionEvent>) => void` | - | Both |
367+
| Type | Default Value | Platform |
368+
|-----------------------------------------------------------|---------------|----------|
369+
| `(NativeSyntheticEvent\<OnChangeSelectionEvent>) => void` | - | Both |
370370

371371
#### `onChangeState`
372372

@@ -394,9 +394,9 @@ interface OnChangeStateEvent {
394394
}
395395
```
396396

397-
| Type | Default Value | Platform |
398-
| ---- | ------------- | -------- |
399-
| `(NativeSyntheticEvent\<OnChangeStateEvent>) => void` | - | Both |
397+
| Type | Default Value | Platform |
398+
|-------------------------------------------------------|---------------|----------|
399+
| `(NativeSyntheticEvent\<OnChangeStateEvent>) => void` | - | Both |
400400

401401
#### `onChangeText`
402402

@@ -412,27 +412,27 @@ interface OnChangeTextEvent {
412412

413413
- `value` is the new text value of the input.
414414

415-
| Type | Default Value | Platform |
416-
| ---- | ------------- | -------- |
417-
| `(NativeSyntheticEvent\<OnChangeTextEvent>) => void` | - | Both |
415+
| Type | Default Value | Platform |
416+
|------------------------------------------------------|---------------|----------|
417+
| `(NativeSyntheticEvent\<OnChangeTextEvent>) => void` | - | Both |
418418

419419
#### `onEndMention`
420420

421421
Callback that is called when the user no longer edits a mention actively - has moved the cursor somewhere else or put a space and the cursor isn't within the edited mention.
422422

423423
- `indicator` is the indicator of the mention that was being edited.
424424

425-
| Type | Default Value | Platform |
426-
| ---- | ------------- | -------- |
427-
| `(indicator: string) => void` | - | Both |
425+
| Type | Default Value | Platform |
426+
|-------------------------------|---------------|----------|
427+
| `(indicator: string) => void` | - | Both |
428428

429429
#### `onFocus`
430430

431431
Callback that's called whenever the input is focused.
432432

433-
| Type | Default Value | Platform |
434-
| ---- | ------------- | -------- |
435-
| `() => void` | - | Both |
433+
| Type | Default Value | Platform |
434+
|--------------|---------------|----------|
435+
| `() => void` | - | Both |
436436

437437
#### `onLinkDetected`
438438

@@ -454,9 +454,9 @@ interface OnLinkDetected {
454454
- `start` is the starting index of the link.
455455
- `end` is the first index after the ending index of the link.
456456

457-
| Type | Default Value | Platform |
458-
| ---- | ------------- | -------- |
459-
| `(OnLinkDetected) => void` | - | Both |
457+
| Type | Default Value | Platform |
458+
|----------------------------|---------------|----------|
459+
| `(OnLinkDetected) => void` | - | Both |
460460

461461
#### `onMentionDetected`
462462

@@ -474,53 +474,53 @@ OnMentionDetected {
474474

475475
- `text` is the mention's displayed text.
476476
- `indicator` is the indicator of the mention.
477-
- `attributes` are the additional user-defined attribtues that are being stored with the mention.
477+
- `attributes` are the additional user-defined attributes that are being stored with the mention.
478478

479-
| Type | Default Value | Platform |
480-
| ---- | ------------- | -------- |
481-
| `(OnMentionDetected) => void` | - | Both |
479+
| Type | Default Value | Platform |
480+
|-------------------------------|---------------|----------|
481+
| `(OnMentionDetected) => void` | - | Both |
482482

483483
#### `onStartMention`
484484

485485
Callback that gets called whenever a mention editing starts (after placing the indicator).
486486

487487
- `indicator` is the indicator of the mention that begins editing.
488488

489-
| Type | Default Value | Platform |
490-
| ---- | ------------- | -------- |
491-
| `(indicator: string) => void` | - | Both |
489+
| Type | Default Value | Platform |
490+
|-------------------------------|---------------|----------|
491+
| `(indicator: string) => void` | - | Both |
492492

493493
#### `placeholder`
494494

495495
The placeholder text that is displayed in the input if nothing has been typed yet. Disappears when something is typed.
496496

497-
| Type | Default Value | Platform |
498-
| ---- | ------------- | -------- |
499-
| `string` | `''` | Both |
497+
| Type | Default Value | Platform |
498+
|----------|---------------|----------|
499+
| `string` | `''` | Both |
500500

501501
#### `placeholderTextColor`
502502

503503
Input placeholder's text color.
504504

505-
| Type | Default Value | Platform |
506-
| ---- | ------------- | -------- |
507-
| [`color`](https://reactnative.dev/docs/colors) | input's [color](#style) | Both |
505+
| Type | Default Value | Platform |
506+
|------------------------------------------------|-------------------------|----------|
507+
| [`color`](https://reactnative.dev/docs/colors) | input's [color](#style) | Both |
508508

509509
#### `ref`
510510

511511
A React ref that lets you call any ref methods on the input.
512512

513-
| Type | Default Value | Platform |
514-
| ---- | ------------- | -------- |
515-
| `RefObject<EnrichedTextInputInstance \| null>` | - | Both |
513+
| Type | Default Value | Platform |
514+
|------------------------------------------------|---------------|----------|
515+
| `RefObject<EnrichedTextInputInstance \| null>` | - | Both |
516516

517517
#### `selectionColor`
518518

519519
Color of the selection rectangle that gets drawn over the selected text. On iOS, the cursor (caret) also gets set to this color.
520520

521-
| Type | Default Value | Platform |
522-
| ---- | ------------- | -------- |
523-
| [`color`](https://reactnative.dev/docs/colors) | system default | Both |
521+
| Type | Default Value | Platform |
522+
|------------------------------------------------|----------------|----------|
523+
| [`color`](https://reactnative.dev/docs/colors) | system default | Both |
524524

525525
#### `style`
526526

@@ -534,9 +534,9 @@ Additionally following [TextStyle](https://reactnative.dev/docs/text#style) prop
534534
- fontWeight
535535
- fontStyle only on Android
536536

537-
| Type | Default Value | Platform |
538-
| ---- | ------------- | -------- |
539-
| [`View Style`](https://reactnative.dev/docs/view#style) \| [`Text Style`](https://reactnative.dev/docs/text#style) | - | Both |
537+
| Type | Default Value | Platform |
538+
|--------------------------------------------------------------------------------------------------------------------|---------------|----------|
539+
| [`View Style`](https://reactnative.dev/docs/view#style) \| [`Text Style`](https://reactnative.dev/docs/text#style) | - | Both |
540540

541541
#### `ViewProps`
542542

@@ -546,9 +546,9 @@ The input inherits [ViewProps](https://reactnative.dev/docs/view#props), but kee
546546

547547
If true, Android will use experimental synchronous events. This will prevent from input flickering when updating component size. However, this is an experimental feature, which has not been thoroughly tested. We may decide to enable it by default in a future release.
548548

549-
| Type | Default Value | Platform |
550-
| ---- | ------------- | -------- |
551-
| `bool` | `false` | Android |
549+
| Type | Default Value | Platform |
550+
|--------|---------------|----------|
551+
| `bool` | `false` | Android |
552552

553553
### Ref Methods
554554

@@ -615,7 +615,7 @@ Sets the currently edited mention with a given indicator, displayed text and cus
615615

616616
- `indicator: string` - the indicator of the set mention.
617617
- `text: string` - the text that should be displayed for the mention. Anything the user typed gets replaced by that text. The mention indicator isn't added to that text.
618-
- `attributes?: Record<string, string>` - additional, custom attribtues for the mention that can be passed as a typescript record. They are properly preserved through parsing from and to the HTML format.
618+
- `attributes?: Record<string, string>` - additional, custom attributes for the mention that can be passed as a typescript record. They are properly preserved through parsing from and to the HTML format.
619619

620620
#### `.setValue()`
621621

@@ -837,7 +837,7 @@ If only a single config is given, the style applies to all mention types. You ca
837837

838838
#### img (inline image)
839839

840-
- `width` is the width of the inline image, deafults to `80`.
840+
- `width` is the width of the inline image, defaults to `80`.
841841
- `height` is the height of the inline image, defaults to `80`.
842842

843843
#### ol (ordered list)
@@ -856,12 +856,12 @@ By bullet we mean the dot that begins each line of the list.
856856
- `bulletColor` defines the color of the bullet, takes [color](https://reactnative.dev/docs/colors) value and defaults to `black`.
857857
- `bulletSize` sets both the height and the width of the bullet, defaults to `8`.
858858
- `marginLeft` is the margin to the left of the bullet (between the bullet and input's left edge), defaults to `16`.
859-
- `gapWidth` sets the gap between the bullet and the list item's text, deafults to `16`.
859+
- `gapWidth` sets the gap between the bullet and the list item's text, defaults to `16`.
860860

861861
## Future Plans
862862

863863
- Adding Codeblocks and Inline Images to iOS input.
864-
- Making some optimalizations around `onChangeHtml` event, maybe some imperative API to get the HTML output.
864+
- Making some optimizations around `onChangeHtml` event, maybe some imperative API to get the HTML output.
865865
- Creating `EnrichedText` text component that supports our HTML output format with all additional interactions like pressing links or mentions.
866866
- Adding API for custom link detection regex.
867867
- Web library implementation via `react-native-web`.

0 commit comments

Comments
 (0)