File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ function exampleContentPlugin(HTML: string, route: HandledRoute) : Promise<strin
144144### <a name =" render-plugin-how-to " ></a > How To Make A Render Plugin
145145The following is a sample __ render plugin__ that adds a title to the head of a page if it doesn't find one.
146146
147- ``` ecmascript 6
147+ ``` typescript
148148function defaultTitlePlugin(html , route ) {
149149 // If no title in the document
150150 if (html .indexOf (' <title' ) < 0 ) {
@@ -164,7 +164,7 @@ is the primary function of a render plugin.
164164
165165Here is another example that would replace any instances of ` :) ` with a smiley emoji:
166166
167- ``` ecmascript 6
167+ ``` typescript
168168function smileEmojiPlugin(html , route ) {
169169 return Promise .resolve (html .replace (/ \:\) / g , ' 😊' ));
170170}
@@ -214,7 +214,7 @@ function exampleFileHandlerPlugin(rawContent: string) : Promise<string> {
214214The following is a sample __ file handler plugin__ that handles CSV by wrapping it in a code block. You could of course,
215215do something much more elaborate like create a table or a grid for this data. Example:
216216
217- ``` ecmascript 6
217+ ``` typescript
218218function csvFilePlugin(raw ) {
219219 return Promise .resolve (` <pre><code>${code }</code></pre> ` );
220220}
You can’t perform that action at this time.
0 commit comments