Skip to content

Commit

Permalink
Add warning tool (#653)
Browse files Browse the repository at this point in the history
* Add warning tool

* Add warning tool

* Use latest list
  • Loading branch information
talyguryn authored Mar 18, 2019
1 parent 98770e2 commit 1178a2f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion example/assets/json-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
5 changes: 4 additions & 1 deletion example/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down Expand Up @@ -125,6 +126,8 @@
shortcut: 'CMD+SHIFT+O'
},

warning: Warning,

marker: {
class: Marker,
shortcut: 'CMD+SHIFT+M'
Expand Down
2 changes: 1 addition & 1 deletion example/tools/list
Submodule list updated from d4cf81 to 964edb
1 change: 1 addition & 0 deletions example/tools/warning
Submodule warning added at d65ead

0 comments on commit 1178a2f

Please sign in to comment.