mirror of https://github.com/rancher/ui.git
Merge pull request #5188 from nwmac/remove-marked-and-dompurify
Remove use of marked and dompurify dependencies
This commit is contained in:
commit
e2613a9afb
|
|
@ -67,9 +67,7 @@
|
|||
expand=(action expandFn)
|
||||
expandOnInit=false
|
||||
}}
|
||||
{{marked-down
|
||||
markdown=model.app.notes
|
||||
}}
|
||||
{{t "generic.removed" }}
|
||||
{{/accordion-list-item}}
|
||||
{{/if}}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
<div class="col span-8">
|
||||
{{#if appReadmeContent}}
|
||||
{{marked-down markdown=appReadmeContent}}
|
||||
{{t "generic.removed" }}
|
||||
{{else if (not noAppReadme)}}
|
||||
<div class="text-center">
|
||||
<i class="icon icon-spinner icon-spin icon-3x"></i>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
<div class="row">
|
||||
{{#if readmeContent}}
|
||||
<div class="col span-12" style="overflow-y: auto; max-height: 500px;">
|
||||
{{marked-down markdown=readmeContent}}
|
||||
{{t "generic.removed" }}
|
||||
</div>
|
||||
{{else}}
|
||||
<h2 class="mb-10">
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
<div class="col span-8">
|
||||
{{#if appReadmeContent}}
|
||||
{{marked-down markdown=appReadmeContent}}
|
||||
{{t "generic.removed" }}
|
||||
{{else if (not noAppReadme)}}
|
||||
<div class="text-center">
|
||||
<i class="icon icon-spinner icon-spin icon-3x"></i>
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
<div class="row">
|
||||
{{#if readmeContent}}
|
||||
<div class="col span-12 readme-content">
|
||||
{{marked-down markdown=readmeContent}}
|
||||
{{t "generic.removed" }}
|
||||
</div>
|
||||
{{else}}
|
||||
<h2 class="mb-10">
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
import Component from '@ember/component';
|
||||
import layout from './template';
|
||||
import { htmlSafe } from '@ember/string';
|
||||
import { get, computed } from '@ember/object';
|
||||
import { next } from '@ember/runloop';
|
||||
|
||||
var Marked = null;
|
||||
var DOMPurify = null;
|
||||
|
||||
export default Component.extend({
|
||||
layout,
|
||||
markdown: null,
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
|
||||
if (!Marked) {
|
||||
import('marked').then( (module) => {
|
||||
Marked = module.default;
|
||||
import('dompurify').then( (module) => {
|
||||
DOMPurify = module.default;
|
||||
|
||||
if ( this.isDestroyed || this.isDestroying ) {
|
||||
return;
|
||||
}
|
||||
|
||||
next(() => this.notifyPropertyChange('parsedMarkdown'));
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
parsedMarkdown: computed('markdown', function() {
|
||||
if ( !Marked ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const html = Marked(get(this, 'markdown'), { breaks: true });
|
||||
|
||||
return htmlSafe(DOMPurify.sanitize(html));
|
||||
}),
|
||||
|
||||
});
|
||||
|
|
@ -1 +0,0 @@
|
|||
{{parsedMarkdown}}
|
||||
|
|
@ -1 +0,0 @@
|
|||
export { default } from 'shared/components/marked-down/component';
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
"dependencies": {
|
||||
"async": "*",
|
||||
"d3": "*",
|
||||
"dompurify": "*",
|
||||
"echarts": "*",
|
||||
"@rancher/ember-api-store": "*",
|
||||
"ember-auto-import": "*",
|
||||
|
|
@ -27,7 +26,6 @@
|
|||
"json2yaml": "*",
|
||||
"jsyaml": "*",
|
||||
"liquid-fire": "*",
|
||||
"marked": "*",
|
||||
"prettycron": "*",
|
||||
"prismjs": "*",
|
||||
"semver": "*",
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
"babel-eslint": "^10.1.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"d3": "3.5.17",
|
||||
"dompurify": "^2.1.1",
|
||||
"dot-object": "^2.1.4",
|
||||
"dotenv": "^8.2.0",
|
||||
"echarts": "4.9.0",
|
||||
|
|
@ -93,7 +92,6 @@
|
|||
"linkifyjs": "^4.1.3",
|
||||
"linkify-string": "^4.1.3",
|
||||
"loader.js": "^4.7.0",
|
||||
"marked": "^2.0.0",
|
||||
"moment": "~2.29.4",
|
||||
"node-sass": "4.14.1",
|
||||
"objects-to-csv": "^1.3.5",
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ generic:
|
|||
persistentVolume: persistent volume
|
||||
random: Random
|
||||
remove: Remove
|
||||
removed: Functionality has been removed from the legacy UI
|
||||
restarts: Restarts
|
||||
role: Role
|
||||
save: Save
|
||||
|
|
|
|||
Loading…
Reference in New Issue