Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace prettify.js with highlight.js #1578

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Mojolicious.pm
Original file line number Diff line number Diff line change
Expand Up @@ -744,11 +744,11 @@ Licensed under the CC-SA License, Version 4.0 L<http://creativecommons.org/licen

Licensed under the MIT License, L<http://creativecommons.org/licenses/MIT>.

=head2 prettify.js
=head2 highlight.js

Copyright (C) 2006, 2013 Google Inc..
Copyright (C) 2006, Ivan Sagalaev.

Licensed under the Apache License, Version 2.0 L<http://www.apache.org/licenses/LICENSE-2.0>.
Licensed under the BSD License, L<https://github.com/highlightjs/highlight.js/blob/master/LICENSE>.

=head1 CODE NAMES

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.hljs {
display: block;
overflow-x: auto;
}
zakame marked this conversation as resolved.
Show resolved Hide resolved

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
color:#fcf0a4;
}

.hljs,
.hljs-subst {
color:#889dbc;
}

.hljs-string,
.hljs-title,
.hljs-name,
.hljs-type,
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-addition,
.hljs-variable,
.hljs-template-tag,
.hljs-template-variable {
color: #9daa7e;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
color:#726d73;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-title,
.hljs-section,
.hljs-doctag,
.hljs-type,
.hljs-name,
.hljs-strong {
font-weight: bold;
color:#d5b57c;
}

.hljs-emphasis {
font-style: italic;
}
402 changes: 402 additions & 0 deletions lib/Mojolicious/resources/public/mojo/highlight.js/highlight.min.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

63 changes: 0 additions & 63 deletions lib/Mojolicious/resources/public/mojo/prettify/run_prettify.js

This file was deleted.

10 changes: 7 additions & 3 deletions lib/Mojolicious/resources/templates/mojo/debug.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
%= javascript '/mojo/jquery/jquery.js'
%= javascript '/mojo/prettify/run_prettify.js'
%= stylesheet '/mojo/prettify/prettify-mojo-dark.css'
%= javascript '/mojo/highlight.js/highlight.min.js'
%= javascript '/mojo/highlight.js/mojolicious.min.js'
%= stylesheet '/mojo/highlight.js/highlight-mojo-dark.css'
<script>
hljs.initHighlightingOnLoad();
</script>
<style>
a img {
border: 0;
Expand Down Expand Up @@ -263,7 +267,7 @@
%= tag 'tr', $i ? (class => 'important') : (), begin
<td class="key"><%= $key %></td>
<td class="value wide">
<pre><code class="prettyprint"><%= $value %></code></pre>
<pre><code><%= $value %></code></pre>
</td>
% end
% end
Expand Down
5 changes: 3 additions & 2 deletions t/mojolicious/exception_lite_app.t
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ subtest 'Reuse exception' => sub {
subtest 'Bundled static files' => sub {
$t->get_ok('/mojo/jquery/jquery.js')->status_is(200)->content_type_is('application/javascript');

$t->get_ok('/mojo/prettify/run_prettify.js')->status_is(200)->content_type_is('application/javascript');
$t->get_ok('/mojo/prettify/prettify-mojo-dark.css')->status_is(200)->content_type_is('text/css');
$t->get_ok('/mojo/highlight.js/highlight.min.js')->status_is(200)->content_type_is('application/javascript');
$t->get_ok('/mojo/highlight.js/mojolicious.min.js')->status_is(200)->content_type_is('application/javascript');
$t->get_ok('/mojo/highlight.js/highlight-mojo-dark.css')->status_is(200)->content_type_is('text/css');

$t->get_ok('/mojo/failraptor.png')->status_is(200)->content_type_is('image/png');
$t->get_ok('/mojo/logo.png')->status_is(200)->content_type_is('image/png');
Expand Down