-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a controlled editor using the grammar parser
- Loading branch information
1 parent
315ee13
commit 76a62ac
Showing
7 changed files
with
2,765 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Controlled Block Editor With Grammar and UI</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel='stylesheet' id='h5-font-css' href='https://fonts.googleapis.com/css?family=Merriweather:700,300,700italic,300italic' /> | ||
<link href="style.css" rel="stylesheet" type="text/css" media="all"> | ||
</head> | ||
<body> | ||
<section class="editor" contenteditable="true"></section> | ||
<div class="controls"></div> | ||
|
||
<script src="lib/rangy-core.js"></script> | ||
<script src="lib/rangy-textrange.js"></script> | ||
<script src="initial-content.js"></script> | ||
<script src="parser.js"></script> | ||
<script src="main.js"></script> | ||
<script src="../navigation.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
window.initialContent = | ||
`<!-- wp:heading --> | ||
1.0 Is The Loneliest Number | ||
<!-- /wp --> | ||
Many entrepreneurs idolize Steve Jobs. He’s such a perfectionist, they say. Nothing leaves the doors of 1 Infinite Loop in Cupertino without a polish and finish that makes geeks everywhere drool. No compromise! | ||
<!-- wp:image --> | ||
<img alt="" src="https://cldup.com/HN3-c7ER9p.jpg"> | ||
<!-- /wp --> | ||
<!-- wp:paragraph --> | ||
I like Apple for the opposite reason: they’re not afraid of getting a rudimentary 1.0 out into the world. | ||
<!-- /wp -->`; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.