Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
0755c538
You need to sign in or sign up before continuing.
Commit
0755c538
authored
Jan 03, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: html rendering order param + decodeEntities
parent
edd11cd7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
renderer.js
server/modules/rendering/html-core/renderer.js
+5
-3
definition.yml
server/modules/rendering/html-security/definition.yml
+1
-0
definition.yml
server/modules/rendering/html-twemoji/definition.yml
+2
-0
renderer.js
server/modules/rendering/html-twemoji/renderer.js
+7
-2
No files found.
server/modules/rendering/html-core/renderer.js
View file @
0755c538
...
@@ -8,7 +8,9 @@ const URL = require('url').URL
...
@@ -8,7 +8,9 @@ const URL = require('url').URL
module
.
exports
=
{
module
.
exports
=
{
async
render
()
{
async
render
()
{
const
$
=
cheerio
.
load
(
this
.
input
)
const
$
=
cheerio
.
load
(
this
.
input
,
{
decodeEntities
:
false
})
if
(
$
.
root
().
children
().
length
<
1
)
{
if
(
$
.
root
().
children
().
length
<
1
)
{
return
''
return
''
...
@@ -230,9 +232,9 @@ module.exports = {
...
@@ -230,9 +232,9 @@ module.exports = {
// STEP: POST
// STEP: POST
// --------------------------------
// --------------------------------
for
(
let
child
of
_
.
filter
(
this
.
children
,
[
'step'
,
'post
'
]))
{
for
(
let
child
of
_
.
sortBy
(
_
.
filter
(
this
.
children
,
[
'step'
,
'post'
]),
[
'order
'
]))
{
const
renderer
=
require
(
`../
${
_
.
kebabCase
(
child
.
key
)}
/renderer.js`
)
const
renderer
=
require
(
`../
${
_
.
kebabCase
(
child
.
key
)}
/renderer.js`
)
output
=
renderer
.
init
(
output
,
child
.
config
)
output
=
await
renderer
.
init
(
output
,
child
.
config
)
}
}
return
output
return
output
...
...
server/modules/rendering/html-security/definition.yml
View file @
0755c538
...
@@ -6,6 +6,7 @@ icon: mdi-fire
...
@@ -6,6 +6,7 @@ icon: mdi-fire
enabledDefault
:
true
enabledDefault
:
true
dependsOn
:
htmlCore
dependsOn
:
htmlCore
step
:
post
step
:
post
order
:
99999
props
:
props
:
safeHTML
:
safeHTML
:
type
:
Boolean
type
:
Boolean
...
...
server/modules/rendering/html-twemoji/definition.yml
View file @
0755c538
...
@@ -5,4 +5,6 @@ author: requarks.io
...
@@ -5,4 +5,6 @@ author: requarks.io
icon
:
mdi-emoticon-happy-outline
icon
:
mdi-emoticon-happy-outline
enabledDefault
:
true
enabledDefault
:
true
dependsOn
:
htmlCore
dependsOn
:
htmlCore
step
:
post
order
:
10
props
:
{}
props
:
{}
server/modules/rendering/html-twemoji/renderer.js
View file @
0755c538
// const twemoji = require('twemoji')
// ------------------------------------
// ------------------------------------
// HTML - Twemoji
// HTML - Twemoji
// ------------------------------------
// ------------------------------------
module
.
exports
=
{
module
.
exports
=
{
init
(
$
,
conf
)
{
init
(
input
,
conf
)
{
// TODO: Must limit to text nodes only (exclude code blocks, already processed emojis, etc.)
//
// return twemoji.parse(input)
return
input
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment