forked from snxraven/p2ns
Updates peer.paste
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
"author": "Raven Scott",
|
"author": "Raven Scott",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@highlightjs/cdn-assets": "^11.11.1",
|
||||||
"@tailwindcss/postcss": "^4.3.0",
|
"@tailwindcss/postcss": "^4.3.0",
|
||||||
"autopass": "^3.4.1",
|
"autopass": "^3.4.1",
|
||||||
"b4a": "^1.8.1",
|
"b4a": "^1.8.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Peer Paste",
|
"name": "Peer Paste",
|
||||||
"version": "1.3.2",
|
"version": "1.3.3",
|
||||||
"domain": "peer.paste",
|
"domain": "peer.paste",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"description": "Temporary P2P text snippets with expiration and burn-after-read options",
|
"description": "Temporary P2P text snippets with expiration and burn-after-read options",
|
||||||
|
|||||||
@@ -137,8 +137,7 @@ function normalizePasteInput(body = {}, existing = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const MARKED_UMD = pathMod.join(PROJECT_ROOT, 'node_modules', 'marked', 'lib', 'marked.umd.js');
|
const MARKED_UMD = pathMod.join(PROJECT_ROOT, 'node_modules', 'marked', 'lib', 'marked.umd.js');
|
||||||
const HIGHLIGHT_ES_ROOT = pathMod.join(PROJECT_ROOT, 'node_modules', 'highlight.js', 'es');
|
const HIGHLIGHT_CDN_ROOT = pathMod.join(PROJECT_ROOT, 'node_modules', '@highlightjs', 'cdn-assets');
|
||||||
const HIGHLIGHT_STYLES_ROOT = pathMod.join(PROJECT_ROOT, 'node_modules', 'highlight.js', 'styles');
|
|
||||||
|
|
||||||
function contentTypeForAsset(filePath) {
|
function contentTypeForAsset(filePath) {
|
||||||
if (filePath.endsWith('.js') || filePath.endsWith('.mjs')) return 'application/javascript; charset=utf-8';
|
if (filePath.endsWith('.js') || filePath.endsWith('.mjs')) return 'application/javascript; charset=utf-8';
|
||||||
@@ -148,15 +147,8 @@ function contentTypeForAsset(filePath) {
|
|||||||
|
|
||||||
function resolveVendorAssetPath(key) {
|
function resolveVendorAssetPath(key) {
|
||||||
if (key === 'marked.min.js') return MARKED_UMD;
|
if (key === 'marked.min.js') return MARKED_UMD;
|
||||||
if (key === 'highlight-dark.css') return pathMod.join(HIGHLIGHT_STYLES_ROOT, 'github-dark.min.css');
|
if (key === 'highlight.min.js') return pathMod.join(HIGHLIGHT_CDN_ROOT, 'highlight.min.js');
|
||||||
|
if (key === 'highlight-dark.css') return pathMod.join(HIGHLIGHT_CDN_ROOT, 'styles', 'github-dark.min.css');
|
||||||
if (key.startsWith('highlight/es/')) {
|
|
||||||
const subPath = key.slice('highlight/es/'.length);
|
|
||||||
const normalized = pathMod.normalize(subPath).replace(/^(\.\.(\/|\\|$))+/, '');
|
|
||||||
const resolved = pathMod.resolve(HIGHLIGHT_ES_ROOT, normalized);
|
|
||||||
if (!resolved.startsWith(HIGHLIGHT_ES_ROOT)) return null;
|
|
||||||
return resolved;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import hljsCore from '/api/vendor/highlight/es/core.js';
|
|
||||||
import jsLang from '/api/vendor/highlight/es/languages/javascript.js';
|
|
||||||
import jsonLang from '/api/vendor/highlight/es/languages/json.js';
|
|
||||||
import bashLang from '/api/vendor/highlight/es/languages/bash.js';
|
|
||||||
import mdLang from '/api/vendor/highlight/es/languages/markdown.js';
|
|
||||||
|
|
||||||
hljsCore.registerLanguage('javascript', jsLang);
|
|
||||||
hljsCore.registerLanguage('json', jsonLang);
|
|
||||||
hljsCore.registerLanguage('bash', bashLang);
|
|
||||||
hljsCore.registerLanguage('markdown', mdLang);
|
|
||||||
|
|
||||||
window.hljs = hljsCore;
|
|
||||||
@@ -91,7 +91,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
<script src="/api/vendor/marked.min.js"></script>
|
<script src="/api/vendor/marked.min.js"></script>
|
||||||
<script type="module" src="/highlight-loader.js"></script>
|
<script src="/api/vendor/highlight.min.js"></script>
|
||||||
<script src="/main.js"></script>
|
<script src="/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user