1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00

🔥 remove unused markdown/preview helper and component

no issue
- `gh-format-markdown` is no longer used
- `gh-ed-preview` is a hangover from the old editor
This commit is contained in:
Kevin Ansfield 2017-03-07 17:43:55 +00:00 committed by Austin Burdine
parent 20ac1e4096
commit d6cbc0244e
2 changed files with 0 additions and 46 deletions

View file

@ -1,33 +0,0 @@
/* global Showdown, html_sanitize */
import {helper} from 'ember-helper';
import {htmlSafe} from 'ember-string';
import cajaSanitizers from 'ghost-admin/utils/caja-sanitizers';
// eslint-disable-next-line new-cap
let showdown = new Showdown.converter({extensions: ['ghostimagepreview', 'ghostgfm', 'footnotes', 'highlight']});
export function formatMarkdown(params) {
if (!params || !params.length) {
return;
}
let markdown = params[0] || '';
let escapedhtml = '';
// convert markdown to HTML
escapedhtml = showdown.makeHtml(markdown);
// replace script and iFrame
escapedhtml = escapedhtml.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
'<pre class="js-embed-placeholder">Embedded JavaScript</pre>');
escapedhtml = escapedhtml.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi,
'<pre class="iframe-embed-placeholder">Embedded iFrame</pre>');
// sanitize html
/* eslint-disable-next-line camelcase */
escapedhtml = html_sanitize(escapedhtml, cajaSanitizers.url, cajaSanitizers.id);
return htmlSafe(escapedhtml);
}
export default helper(formatMarkdown);

View file

@ -1,13 +0,0 @@
{{previewHTML}}
{{#each imageUploadComponents as |uploader|}}
{{#ember-wormhole to=uploader.destinationElementId}}
{{gh-image-uploader-with-preview
image=uploader.src
altText=uploader.altText
update=(action "updateImageSrc" uploader.index)
remove=(action "updateImageSrc" uploader.index "")
uploadStarted=uploadStarted
uploadFinished=uploadFinished}}
{{/ember-wormhole}}
{{/each}}