Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$('#view-list .page-list-ul-flat .page-list-link').each(function() {
const $link = $(this);
/* eslint-disable-next-line no-unused-vars */
const text = $link.text();
let path = decodeURIComponent($link.data('path'));
const shortPath = decodeURIComponent($link.data('short-path')); // convert to string
if (path == null || shortPath == null) {
// continue
return;
}
path = entities.encodeHTML(path);
const pattern = `${escapeStringRegexp(entities.encodeHTML(shortPath))}(/)?$`;
$link.html(path.replace(new RegExp(pattern), `<strong>${shortPath}$1</strong>`));
});
break;
}
endpos = ends.index;
replacements.push(str.substring(prev, pos - buff));
remainder = str.substring(pos + endpos + 3);
var code = str.substring(pos, pos + endpos);
code = code.trim('(\r\n|\n)');
pos = pos + endpos + 3;
if (lang === null) {
replacements.push('<pre><code class="hljs">' + hljs.highlightAuto(code).value + '</code></pre>');
} else {
try {
if (lang === 'no-highlight') {
replacements.push('<pre><code class="hljs ' + lang + '">' + entities.encodeHTML(code) + '</code></pre>');
} else {
replacements.push('<pre><code class="hljs ' + lang + '">' + hljs.highlight(lang, code).value + '</code></pre>');
}
} catch (err) {
replacements.push('<pre><code>' + hljs.highlightAuto(code).value + '</code></pre>');
}
}
}
if (pos < (str.length - 1)) {
replacements.push(str.substring(pos));
}
files[file].contents = new Buffer(replacements.join(''));
debug(files[file].contents.toString());
});
};
process: function(bot, msg, suffix) {
if (suffix && suffix.toLowerCase() == 'me') bot.sendMessage(msg, `💀 `);
else if (suffix) bot.sendMessage(msg, `💀 `);
else bot.sendMessage(msg, "💀 ");
}
},
process: function(bot, msg, suffix) {
if (suffix && suffix.toLowerCase() == 'me') bot.sendMessage(msg, `💀 `);
else if (suffix) bot.sendMessage(msg, `💀 `);
else bot.sendMessage(msg, "💀 ");
}
},
swig.setFilter('encodeHTML', (string) => {
return entities.encodeHTML(string);
});
process(code, lang) {
const config = crowi.getConfig();
if (!config.env.PLANTUML_URI) {
return `<pre class="wiki-code"><code>${entities.encodeHTML(code)}\n</code></pre>`;
}
let plantumlUri = config.env.PLANTUML_URI;
if (plantumlUri.substr(-1) !== '/') {
plantumlUri += '/';
}
const id = this.generateId(code + lang);
const encoded = plantuml.encode(`@startuml
skinparam monochrome true
${code}
@enduml`);
return `
<div class="plantuml noborder" id="${id}"></div>
export const code = str => `<code>${encodeHTML(str)}</code>`
type: 'Boolean',
defaultValue: code('false'),
description: 'When user selects a node, automatically select its ancestors. Applies to flat mode only.',
}, {
name: 'autoSelectDescendants',
type: 'Boolean',
defaultValue: code('false'),
description: 'When user selects a node, automatically select its descendants. Applies to flat mode only.',
}, {
name: 'backspaceRemoves',
type: 'Boolean',
defaultValue: code('true'),
description: 'Whether <kbd>Backspace</kbd> removes the last item if there is no text input.',
}, {
name: 'beforeClearAll',
type: encodeHTML(`Fn${makeArgNameList([])} 🡒 (Boolean | Promise)`),
defaultValue: code('() => true'),
description: `Function that processes before clearing all input fields. Return ${code('false')} to stop values being cleared.`,
}, {
name: 'branchNodesFirst',
type: 'Boolean',
defaultValue: code('false'),
description: 'Show branch nodes before leaf nodes.',
}, {
name: 'cacheOptions',
type: 'Boolean',
defaultValue: code('true'),
description: `Whether to cache results of each search request for ${link('#async-searching', 'async search mode')}.`,
}, {
name: 'clearable',
type: 'Boolean',
defaultValue: code('true'),
hbs.registerHelper('json', function(obj) {
let jsonValue = JSON.stringify(obj);
let val = entities.encodeHTML(jsonValue);
return new hbs.SafeString(val);
});