@opositatest/markdown-text-editor 1.4.0 → 1.4.1-canary.97fb01a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +51 -0
  2. package/dist/editor.js +10156 -10088
  3. package/dist/react/index.js +2808 -2740
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -30,9 +30,60 @@ The editor currently focuses on text-first rich content that serializes cleanly
30
30
  - Block quotes
31
31
  - Code blocks
32
32
  - Links
33
+ - Tables
33
34
  - Inline styles: bold, italic, underline, strikethrough, and inline code
34
35
  - Display math blocks written in LaTeX
35
36
 
37
+ Indented / nested blocks are **not** part of the supported surface: `Tab` never indents (see [Tab key](#tab-key)).
38
+
39
+ ### Tab key
40
+
41
+ `Tab` behaves like it does in any other form control: it moves focus to the next focusable element of the
42
+ host page (`Shift-Tab` moves to the previous one), so it never indents a block or uses the browser's focus as a
43
+ trap. `Escape` still blurs the editor.
44
+
45
+ The only exceptions are BlockNote's own behaviours *inside* a block:
46
+
47
+ - **Code blocks**: `Tab` inserts two spaces. `Shift-Tab` leaves the editor.
48
+ - **Tables**: `Tab` / `Shift-Tab` move between cells. At the first/last cell they leave the editor instead of
49
+ indenting the table.
50
+
51
+ Markdown that already contains nested lists (pasted content or a document saved before this rule) is still
52
+ parsed and re-exported, but indentation can no longer be created from the keyboard, and a paragraph nested under
53
+ a list item is currently flattened out of it when the document is saved again.
54
+
55
+ ### Numbered apartados and literal numbers
56
+
57
+ A number you type is **never** turned into an automatic list, so the number you wrote is the number that is
58
+ saved. Typing `1. `, `2. `, `3.ª`… at the start of a line just writes that text, exactly like the BOE does, and
59
+ apartados that are cited elsewhere by number are never renumbered:
60
+
61
+ - `1. No será preciso…` and `3. Tampoco será preciso…` stay two lines of text, aligned the same way, even when
62
+ the second one skips a number.
63
+ - Markdown cannot express "1, 3": inside a list only the first item's number is kept and the editor paints every
64
+ other number from the item's position, which is why an automatic list cannot hold a number you wrote.
65
+
66
+ This is also why paragraph text that starts with a block marker is escaped when the document is saved
67
+ (`3. No será preciso` is stored as `3\. No será preciso`). Without the escape, that line would come back as a
68
+ numbered list item, so the number would stop being text and start being renumbered. The escape renders exactly
69
+ the same in any Markdown renderer.
70
+
71
+ To create an actual numbered list, use the slash menu (`/lista numerada`), the block type selector or
72
+ `Ctrl/⌘+Shift+7`; it keeps its own positional numbering, and Markdown documents that already contain lists are
73
+ loaded as lists.
74
+
75
+ ### Pasting
76
+
77
+ Pasted content is taken at face value: the `text/html` flavour when the source provides it, plain text otherwise.
78
+ It is never *guessed* to be Markdown, because the plain text of a legal document is full of lines starting with
79
+ `1. `, and parsing it as Markdown turned the apartados into an automatic list that then renumbered them (`1.`,
80
+ `3.` came back as `1.`, `2.`).
81
+
82
+ - `Ctrl/⌘+V` from a web page keeps the HTML structure — headings, bold, links — with the numbers as text.
83
+ - `Ctrl/⌘+Shift+V` (paste without formatting) inserts the text literally, which is what the **Quitar formato**
84
+ button suggests when the source formatting is not wanted.
85
+ - Explicit Markdown still works: `text/markdown` on the clipboard, and the editor's own `pasteMarkdown()`.
86
+
36
87
  ### Math / LaTeX blocks
37
88
 
38
89
  The package includes a custom math block on top of the default BlockNote schema. It renders display formulas with KaTeX and stores them as fenced display-math blocks in Markdown: