Add warning tool (#653)

* Add warning tool

* Add warning tool

* Use latest list
This commit is contained in:
Taly 2019-03-18 17:20:57 +03:00 committed by GitHub
parent 98770e26d3
commit 1178a2f9e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 3 deletions

3
.gitmodules vendored
View file

@ -43,3 +43,6 @@
[submodule "example/tools/raw"]
path = example/tools/raw
url = https://github.com/editor-js/raw
[submodule "example/tools/warning"]
path = example/tools/warning
url = https://github.com/editor-js/warning

View file

@ -31,7 +31,7 @@ const cPreview = (function (module) {
/** Stylize JSON keys */
string = string.replace( /"(\w+)"\s?:/g, '"<span class=sc_key>$1</span>" :');
/** Stylize tool names */
string = string.replace( /"(paragraph|quote|list|header|link|code|image|delimiter|raw|checklist|table|embed)"/g, '"<span class=sc_toolname>$1</span>"');
string = string.replace( /"(paragraph|quote|list|header|link|code|image|delimiter|raw|checklist|table|embed|warning)"/g, '"<span class=sc_toolname>$1</span>"');
/** Stylize HTML tags */
string = string.replace( /(&lt;[\/a-z]+(&gt;)?)/gi, '<span class=sc_tag>$1</span>' );
/** Stylize strings */

View file

@ -55,7 +55,8 @@
<script src="./tools/embed/dist/bundle.js"></script><!-- Embed -->
<script src="./tools/table/dist/bundle.js"></script><!-- Table -->
<script src="./tools/link/dist/bundle.js"></script><!-- Link -->
<script src="./tools/raw/dist/bundle.js"></script><!-- Link -->
<script src="./tools/raw/dist/bundle.js"></script><!-- Raw -->
<script src="./tools/warning/dist/bundle.js"></script><!-- Warning -->
<script src="./tools/marker/dist/bundle.js"></script><!-- Marker -->
<script src="./tools/inline-code/dist/bundle.js"></script><!-- Inline Code -->
@ -125,6 +126,8 @@
shortcut: 'CMD+SHIFT+O'
},
warning: Warning,
marker: {
class: Marker,
shortcut: 'CMD+SHIFT+M'

@ -1 +1 @@
Subproject commit d4cf81cf76f84d663f28135e791c821298ddf3eb
Subproject commit 964edb412f9ddfe60c6e71d6ed0c5b86d093185c

1
example/tools/warning Submodule

@ -0,0 +1 @@
Subproject commit d65ead448d74d0e6adc42f14cefb9e7a5aad8320