mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: optimize fps problem display
This commit is contained in:
1 parent
9fabb42c2e
commit
9901de944f
2 files changed
+13
-3
No files matched your search
@@ -59,7 +59,7 @@ class FpsProblemImportHandler extends Handler {
|
|||||||
memory: p.memory_limit[0]._ + p.memory_limit[0].$.unit,
|
memory: p.memory_limit[0]._ + p.memory_limit[0].$.unit,
|
||||||
};
|
};
|
||||||
const title = decodeHTML(p.title.join(' '));
|
const title = decodeHTML(p.title.join(' '));
|
||||||
const tags = _.filter(p.source, (i: string) => i.trim());
|
const tags = _.filter(p.source, (i: string) => i.trim()).flatMap((i) => i.split(' ')).filter((i) => i);
|
||||||
const pid = await ProblemModel.add(domainId, null, title, buildContent(content, 'html'), this.user._id, tags);
|
const pid = await ProblemModel.add(domainId, null, title, buildContent(content, 'html'), this.user._id, tags);
|
||||||
const tasks = [
|
const tasks = [
|
||||||
ProblemModel.edit(domainId, pid, { html: true }),
|
ProblemModel.edit(domainId, pid, { html: true }),
|
||||||
|
|||||||
@@ -75,12 +75,12 @@ export const xss = new Xss.FilterXSS({
|
|||||||
li: [],
|
li: [],
|
||||||
mark: [],
|
mark: [],
|
||||||
ol: [],
|
ol: [],
|
||||||
p: [],
|
p: ['align', 'style'],
|
||||||
pre: [],
|
pre: [],
|
||||||
s: [],
|
s: [],
|
||||||
section: [],
|
section: [],
|
||||||
small: [],
|
small: [],
|
||||||
span: ['class'],
|
span: ['class', 'style'],
|
||||||
sub: [],
|
sub: [],
|
||||||
summary: [],
|
summary: [],
|
||||||
sup: [],
|
sup: [],
|
||||||
@@ -98,6 +98,16 @@ export const xss = new Xss.FilterXSS({
|
|||||||
var: [],
|
var: [],
|
||||||
video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width'],
|
video: ['autoplay', 'controls', 'loop', 'preload', 'src', 'height', 'width'],
|
||||||
},
|
},
|
||||||
|
css: {
|
||||||
|
whiteList: {
|
||||||
|
'font-size': true,
|
||||||
|
'font-family': true,
|
||||||
|
'text-align': true,
|
||||||
|
'text-indent': true,
|
||||||
|
'margin-left': true,
|
||||||
|
color: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
allowCommentTag: false,
|
allowCommentTag: false,
|
||||||
stripIgnoreTagBody: ['script'],
|
stripIgnoreTagBody: ['script'],
|
||||||
safeAttrValue(tag, name, value) {
|
safeAttrValue(tag, name, value) {
|
||||||
|
|||||||
Reference in new issue
Block a user