Skip to content
Browse files

Highlighting only inside <code>

  • Loading branch information...
1 parent b535853 commit d8c7ea9837552b3e485d9135a2fb72fc2e15dce5 @vrana committed Nov 12, 2010
Showing with 4 additions and 6 deletions.
  1. +1 −1 adminer/include/adminer.inc.php
  2. +1 −1 adminer/sql.inc.php
  3. +1 −2 adminer/static/editing.js
  4. +1 −2 adminer/static/functions.js
View
2 adminer/include/adminer.inc.php
@@ -398,7 +398,7 @@ function messageQuery($query) {
? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
: $query
); //! respect $_GET["ns"]
- return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$jush'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
+ return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre><code class='jush-$jush'>" . shorten_utf8($query, 1000) . '</code></pre><p><a href="' . h(str_replace("db=" . urlencode(DB), "db=" . urlencode($_GET["db"]), ME) . 'sql=&history=' . (count($history[$_GET["db"]]) - 1)) . '">' . lang('Edit') . '</a></div>';
}
/** Functions displayed in edit form
View
2 adminer/sql.inc.php
@@ -59,7 +59,7 @@
$empty = false;
$q = substr($query, 0, $match[0][1]);
$commands++;
- echo "<pre class='jush-$jush' id='sql-$commands'>" . shorten_utf8(trim($q), 1000) . "</pre>\n";
+ echo "<pre id='sql-$commands'><code class='jush-$jush'>" . shorten_utf8(trim($q), 1000) . "</code></pre>\n";
ob_flush();
flush(); // can take a long time - show the running query
$start = explode(" ", microtime()); // microtime(true) is available since PHP 5
View
3 adminer/static/editing.js
@@ -22,8 +22,7 @@ function bodyLoad(version, protocol) {
if (window.jushLinks) {
jush.custom_links = jushLinks;
}
- jush.highlight_tag('pre', 0);
- jush.highlight_tag('code');
+ jush.highlight_tag('code', 0);
}
};
script.onreadystatechange = function () {
View
3 adminer/static/functions.js
@@ -223,8 +223,7 @@ function ajaxSend(url, data) {
clearTimeout(ajaxTimeout);
setHtml('main', text);
if (window.jush) {
- jush.highlight_tag('code');
- jush.highlight_tag('pre', 0);
+ jush.highlight_tag('code', 0);
}
}
}, data);

0 comments on commit d8c7ea9

Please sign in to comment.
Something went wrong with that request. Please try again.