tiny-markdown-editor 0.2.28 → 0.2.29
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.
- package/README.md +1 -1
- package/dist/demo.html +11 -3
- package/dist/tiny-mde.css +47 -0
- package/dist/tiny-mde.js +551 -149
- package/dist/tiny-mde.min.css +1 -1
- package/dist/tiny-mde.min.js +1 -1
- package/dist/tiny-mde.tiny.js +1 -1
- package/lib/TinyMDE.d.ts +63 -0
- package/lib/TinyMDE.js +423 -36
- package/lib/grammar.d.ts +7 -0
- package/lib/grammar.js +60 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ TinyMDE can be used as a drop-in text area replacement.
|
|
|
16
16
|
|
|
17
17
|
TinyMDE was motivated by wanting to improve on [EasyMDE](https://github.com/Ionaru/easy-markdown-editor) which is extremely flexible but had two shortcomings:
|
|
18
18
|
|
|
19
|
-
- EasyMDE depends on [Code Mirror](https://codemirror.net/) for editing and formatting. CodeMirror is a full fledged and customizable in-browser code editor, and has a price: EasyMDE's JS file is 280kb in size. TinyMDE is less than
|
|
19
|
+
- EasyMDE depends on [Code Mirror](https://codemirror.net/) for editing and formatting. CodeMirror is a full fledged and customizable in-browser code editor, and has a price: EasyMDE's JS file is 280kb in size. TinyMDE is less than 90kb (less than a third of EasyMDE's size), the "tiny" version without the toolbar even below 80kb!
|
|
20
20
|
- CodeMirror doesn't work well on mobile, at least not for writing prose: mobile phone OS auto-correction functionality, which many people rely on to quickly type on mobile, is not supported by CodeMirror.
|
|
21
21
|
|
|
22
22
|
## Install TinyMDE
|
package/dist/demo.html
CHANGED
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
[ref]: https://www.jefago.com
|
|
16
16
|
[ref link]: </this has spaces> "and a title"
|
|
17
17
|
|
|
18
|
+
- [ ] Task list item (click the box to toggle)
|
|
19
|
+
- [x] Completed task with *inline* formatting
|
|
20
|
+
|
|
18
21
|
|
|
19
22
|
Some <html> </tags> right here
|
|
20
23
|
<html a="b" >
|
|
@@ -56,14 +59,15 @@ And another [ref link][].
|
|
|
56
59
|
A valid [link to a ref][ref] here.
|
|
57
60
|
An invalid [ref link][nope].
|
|
58
61
|
An [inline link](/inline) here.
|
|
59
|
-
Some [inline](<links>) [inline](<link link> "title title") [inline](<link link> (title title)) [inline]( <link link> 'title
|
|
62
|
+
Some valid [inline](<links>) [inline](<link link> "title \" title") [inline](<link link> (title title)) [inline]( <link link> 'title \' title') ss
|
|
60
63
|
[Inline]( /with invalid title text ) here.
|
|
61
64
|
[Inline]( </with (complex) dest> (and title text) ) here.
|
|
62
65
|
[Inline](<> "") link with empty delimiters
|
|
63
66
|
[Inline]() link completely empty
|
|
64
67
|
[Valid link](")))") here
|
|
65
68
|
[Valid link](<)))>) here
|
|
66
|
-
[Invalid]( ( ) here
|
|
69
|
+
[Invalid]( ( ) here
|
|
70
|
+
[Invalid](<link> "title \\" here")
|
|
67
71
|
This one [is *a](link) over* here, but not an emphasis.
|
|
68
72
|
Here [the [inner](one) is] the valid link.
|
|
69
73
|
An  a](link) inside it.
|
|
@@ -99,7 +103,11 @@ block
|
|
|
99
103
|
-
|
|
100
104
|
|
|
101
105
|
1) OL
|
|
102
|
-
2) OL
|
|
106
|
+
2) OL
|
|
107
|
+
|
|
108
|
+
- [ ] Task list item (click the box to toggle)
|
|
109
|
+
- [x] Completed task with *inline* formatting
|
|
110
|
+
1. [ ] Ordered task item</textarea>
|
|
103
111
|
</div>
|
|
104
112
|
<div id="status" style="text-align:right">- : -</div>
|
|
105
113
|
<script>
|
package/dist/tiny-mde.css
CHANGED
|
@@ -96,6 +96,53 @@
|
|
|
96
96
|
color:#ff8080;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
/* Task list checkbox: only the inner character (space/x/X) of `[ ]` / `[x]` is rendered as a drawn
|
|
100
|
+
checkbox. The character stays in the DOM as real, navigable text (its glyph is just hidden), so
|
|
101
|
+
the line's text content still equals its source. The surrounding `[` `]` keep the .TMMark style. */
|
|
102
|
+
|
|
103
|
+
.TMMark_TMTask {
|
|
104
|
+
color: #e0e0e0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.TMCheckbox {
|
|
108
|
+
position: relative;
|
|
109
|
+
color: transparent;
|
|
110
|
+
caret-color: #000000;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
font-family: monospace;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.TMCheckbox::before {
|
|
116
|
+
content: "";
|
|
117
|
+
position: absolute;
|
|
118
|
+
left: 50%;
|
|
119
|
+
top: 50%;
|
|
120
|
+
transform: translateX(-50%) translateY(-50%);
|
|
121
|
+
width: 0.85em;
|
|
122
|
+
height: 0.85em;
|
|
123
|
+
border: 1px solid #c0c0c0;
|
|
124
|
+
box-sizing: border-box;
|
|
125
|
+
border-radius: 2px;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.TMCheckbox_checked::before {
|
|
130
|
+
border-color: #2aa775;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.TMCheckbox_checked::after {
|
|
134
|
+
content: "✓";
|
|
135
|
+
color: #2aa775;
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 50%;
|
|
138
|
+
left: 50%;
|
|
139
|
+
transform: translateX(-50%) translateY(-50%);
|
|
140
|
+
text-align: center;
|
|
141
|
+
vertical-align: top;
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
99
146
|
.TMImage {
|
|
100
147
|
text-decoration: underline;
|
|
101
148
|
-webkit-text-decoration-color: #00ff00;
|