This repository has been archived by the owner on Feb 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 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,33 @@ | ||
# 0.2.46 | ||
|
||
Adds a filter-for-export filter: | ||
|
||
This formatter walks through the content tree. | ||
|
||
At each node it checks if the node implements a method `filterForExport` | ||
|
||
If so, the method is called. | ||
|
||
In this way, custom elements can filter out their contents from export. | ||
|
||
So if an editor includes an element: `<custom-element></custom-element>`, | ||
|
||
And the custom element sets some content such that inner html looks like: | ||
|
||
`<custom-element>Content For Display</custom-element>` | ||
|
||
The prototype for `<custom-element>` may implement `filterForExport` thusly: | ||
|
||
``` | ||
CustomElement.prototype.filterForExport = function () { | ||
this.innerHTML == ''; | ||
} | ||
``` | ||
|
||
And the exported html will look like this: | ||
|
||
`<custom-element></custom-element>` | ||
|
||
In this way a custom element my render demonstrative content inside the editor, | ||
but not have that content saved to our database. | ||
|