mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: html problem display
This commit is contained in:
1 parent
bf4d0d6fdd
commit
1b906e3eeb
5 files changed
+6
-5
No files matched your search
@@ -9,6 +9,7 @@ const argv = require('cac')().parse();
|
|||||||
const { findFileSync } = require('@hydrooj/utils/lib/utils');
|
const { findFileSync } = require('@hydrooj/utils/lib/utils');
|
||||||
const status = require('@hydrooj/utils/lib/status');
|
const status = require('@hydrooj/utils/lib/status');
|
||||||
const markdown = require('./markdown');
|
const markdown = require('./markdown');
|
||||||
|
const { xss } = require('./markdown-it-xss');
|
||||||
|
|
||||||
const { misc, buildContent, avatar } = global.Hydro.lib;
|
const { misc, buildContent, avatar } = global.Hydro.lib;
|
||||||
|
|
||||||
@@ -86,7 +87,7 @@ class Nunjucks extends nunjucks.Environment {
|
|||||||
else s = s[langs[0]];
|
else s = s[langs[0]];
|
||||||
}
|
}
|
||||||
if (s instanceof Array) s = buildContent(s, html ? 'html' : 'markdown', (str) => str.translate(language));
|
if (s instanceof Array) s = buildContent(s, html ? 'html' : 'markdown', (str) => str.translate(language));
|
||||||
return markdown.render(s);
|
return html ? xss.process(s) : markdown.render(s);
|
||||||
});
|
});
|
||||||
this.addFilter('log', (self) => {
|
this.addFilter('log', (self) => {
|
||||||
console.log(self);
|
console.log(self);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.26.4",
|
"version": "4.26.5",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ function buildCategoryFilter() {
|
|||||||
// de-select children
|
// de-select children
|
||||||
_.forEach(treeItem.children, (treeSubItem, subcategory) => {
|
_.forEach(treeItem.children, (treeSubItem, subcategory) => {
|
||||||
if (treeSubItem.select) {
|
if (treeSubItem.select) {
|
||||||
treeSubItem.select = false; // eslint-disable-line no-param-reassign
|
treeSubItem.select = false;
|
||||||
dirtyCategories.push({ type: 'subcategory', subcategory, category });
|
dirtyCategories.push({ type: 'subcategory', subcategory, category });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ function buildCategoryFilter() {
|
|||||||
// de-select children
|
// de-select children
|
||||||
_.forEach(treeItem.children, (treeSubItem, subcategory) => {
|
_.forEach(treeItem.children, (treeSubItem, subcategory) => {
|
||||||
if (treeSubItem.select) {
|
if (treeSubItem.select) {
|
||||||
treeSubItem.select = false; // eslint-disable-line no-param-reassign
|
treeSubItem.select = false;
|
||||||
dirtyCategories.push({ type: 'subcategory', subcategory, category });
|
dirtyCategories.push({ type: 'subcategory', subcategory, category });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
|
||||||
<div class="medium-3 columns">
|
<div class="medium-3 columns">
|
||||||
|
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||||
<div class="section side nojs--hide">
|
<div class="section side nojs--hide">
|
||||||
<ol class="menu">
|
<ol class="menu">
|
||||||
<a href="javascript:;" class="menu__link edit-mode-hide" name="enter-edit-mode">
|
<a href="javascript:;" class="menu__link edit-mode-hide" name="enter-edit-mode">
|
||||||
|
|||||||
Reference in new issue
Block a user