summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toastin.space>2019-02-26 00:22:20 -0500
committerChloe Kudryavtsev <toast@toastin.space>2019-02-26 00:22:20 -0500
commit2281201989c090136dfc11f7b159c5acad53cfbf (patch)
tree64c4513bfac0f869b982e9658efcfc10e71c9391
parentInitial draft version (diff)
Always use language
Just default to "none" instead of empty. This means that the css will apply by default.
-rw-r--r--source/web.d2
-rw-r--r--views/code.dt8
2 files changed, 3 insertions, 7 deletions
diff --git a/source/web.d b/source/web.d
index ca3b644..bfabda2 100644
--- a/source/web.d
+++ b/source/web.d
@@ -39,7 +39,7 @@ class BRPaste {
@path("/:id")
void getId(string _id) {
if (!client.exists(_id)) throw new HTTPStatusException(404);
- string language;
+ string language = "none";
// TODO: rewrite the next two lines once #2273 is resolved
auto req = request;
if (req.query.length > 0) language = req.query.byKey.front;
diff --git a/views/code.dt b/views/code.dt
index 255af74..7479ce1 100644
--- a/views/code.dt
+++ b/views/code.dt
@@ -8,16 +8,12 @@ block scripts
block bodyscripts
script(
src='#{prefix}/prism.min.js')
- - import std.array;
- - if(!language.empty)
+ - if(language != "none")
script(
src='#{prefix}/components/prism-#{language}.min.js')
block content
pre
- - import std.array;
- - string lang = "none";
- - if (!language.empty) lang = language;
- code(class='language-#{lang}')= data
+ code(class='language-#{language}')= data
//- vim: ft=pug