mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-24 17:11:43 +00:00
Merge branch 'master' of https://github.com/supertiger1234/Nertivia---Client
This commit is contained in:
commit
d20c7d381d
2 changed files with 27 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
const config = {
|
const config = {
|
||||||
devMode:true,
|
devMode:true,
|
||||||
|
breeMode: true,
|
||||||
recaptcha: "",
|
recaptcha: "",
|
||||||
IP: [
|
IP: [
|
||||||
{
|
{
|
||||||
|
|
@ -23,6 +24,11 @@ if ( config.devMode ) {
|
||||||
config.recaptcha = "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI";
|
config.recaptcha = "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI";
|
||||||
config['domain'] = config.IP[0].domain;
|
config['domain'] = config.IP[0].domain;
|
||||||
config['socketIP'] = config.IP[0].socketIP;
|
config['socketIP'] = config.IP[0].socketIP;
|
||||||
|
|
||||||
|
if( config.breeMode ) {
|
||||||
|
config['domain'] = config.IP[1].domain;
|
||||||
|
config['socketIP'] = config.IP[1].socketIP;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
config.recaptcha = "6Ld0EIwUAAAAALJNTa-1s63l-w_jHyCY6dFAVwKe";
|
config.recaptcha = "6Ld0EIwUAAAAALJNTa-1s63l-w_jHyCY6dFAVwKe";
|
||||||
config['domain'] = config.IP[1].domain;
|
config['domain'] = config.IP[1].domain;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export default (message) => {
|
||||||
name: 'code-block',
|
name: 'code-block',
|
||||||
symbol: '``\`',
|
symbol: '``\`',
|
||||||
recursive: false,
|
recursive: false,
|
||||||
transformer: text => `<div class="codeblock"><code>${text.trim()}</code></div>`,
|
transformer: text => `<div class="codeblock"><code>${formatCode(text.trim())}</code></div>`,
|
||||||
})
|
})
|
||||||
|
|
||||||
futoji.addTransformer({
|
futoji.addTransformer({
|
||||||
|
|
@ -53,6 +53,26 @@ export default (message) => {
|
||||||
return futoji.format(message);
|
return futoji.format(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* format code to add syntax highlighting
|
||||||
|
*/
|
||||||
|
function formatCode(text) {
|
||||||
|
// matches if word until newline
|
||||||
|
// if spaces then it won't match
|
||||||
|
let nameRegex = new RegExp('^(\\w+)\\n')
|
||||||
|
|
||||||
|
if(nameRegex.test(text)) {
|
||||||
|
let language = nameRegex.exec(text)[1]
|
||||||
|
let newText = text.replace(nameRegex, '')
|
||||||
|
|
||||||
|
// TODO: format newText with language
|
||||||
|
|
||||||
|
return newText
|
||||||
|
}
|
||||||
|
|
||||||
|
return text
|
||||||
|
}
|
||||||
|
|
||||||
function escapeHtml(unsafe) {
|
function escapeHtml(unsafe) {
|
||||||
return unsafe
|
return unsafe
|
||||||
.replace(/&/g, "&")
|
.replace(/&/g, "&")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue