Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove extra <script> tag in example code

Sumh <42424861@qq.com>
  • Loading branch information...
commit f9f96197b6f925c3821188710daaf14cedb22caf 1 parent 9f31be2
Sumh authored
View
8 classes/controller/jqdoc.php
@@ -319,10 +319,10 @@ public function parse_entries()
break;
case 'css':
$tags = preg_replace('/^[\t\s]*\n+/m', '', ((string) $tags));
- $css = "&lt;style&gt; ".'<span class="sunlight-highlight-css">'.htmlspecialchars(trim($tags)).'</span>&lt;/style&gt;';
+ $css = '<span class="sunlight-highlight-css">'.htmlspecialchars(trim($tags)).'</span>';
break;
case 'code':
- $code = "&lt;script&gt; ".'<span class="sunlight-highlight-javascript">'.htmlspecialchars(trim($tags)).'</span>&lt;/script&gt;';
+ $code = htmlspecialchars(trim($tags));
break;
case 'html':
$demo = htmlspecialchars((string) $tags);
@@ -334,12 +334,12 @@ public function parse_entries()
{
$html[$method] .= '<dd class="example"><pre><code class="demo-code sunlight-highlight-html">'
.strtr(htmlspecialchars($this->demo_html), array(
- '{{style}}' => $css, '{{html}}' => $demo, '{{script}}' => $code
+ '{{style}}' => $css, '{{html}}' => $demo, '{{script}}' => '<span class="sunlight-highlight-javascript">'.$code.'</span>'
)).'</code></pre></dd><dd class="demo"><h4>Demo: </h4><div class="code-demo"></div></dd>';
}
else
{
- $html[$method] .= '<dd class="example"><pre><code class="sunlight-highlight-html">'.$code.'</code></pre></dd>';
+ $html[$method] .= '<dd class="example"><pre class="sunlight-highlight-javascript">'.$code.'</pre></dd>';
}
}
View
BIN  jQuery-UI-Reference-1.5.1.chm
Binary file not shown
View
4 views/jqdoc-demo.php
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html>
<head>
- {{style}}
<script src="../jquery.min.js"></script>
+ <style>{{style}}</style>
</head>
<body>
{{html}}
- {{script}}
+ <script>{{script}}</script>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.