powered by nequal
Home » HatenaSyntax » Timeline » 944

Changeset 944 -- 2009-06-10 20:28:09

Author
anatoo
Comment
サンプル修正。レンダラのバグ修正。

Diffs

HatenaSyntax/trunk/sample/sample1.php

@@ -43,7 +43,6 @@
{
foreach ($lines as &$line) $line = htmlspecialchars($line, ENT_QUOTES, 'utf-8');
$body = join(PHP_EOL, $lines);
-    if (!empty($body)) $body = substr($body, 0, -strlen(PHP_EOL));
return '<pre class="superpre ' . htmlspecialchars($type, ENT_QUOTES, 'utf-8')
. '">' . PHP_EOL . $body . '</pre>';
}
@@ -108,7 +107,7 @@
<pre class="superpre php">
&lt;?php
-echo &quot;hogehoge&quot</pre>
+echo &quot;hogehoge&quot;;</pre>
<p><a href="http://google.com">http://google.com</a></p>
</div>

HatenaSyntax/trunk/code/HatenaSyntax/Renderer.php

@@ -41,8 +41,7 @@
static function superPreHandler($type, $lines)
{
$body = join(PHP_EOL, array_map(array('HatenaSyntax_Renderer', 'escape'), $lines));
-        if (!empty($body)) $body = substr($body, 0, -strlen(PHP_EOL));
-        return '<pre class="superpre">' . $body . '</pre>';
+        return '<pre class="superpre">' . PHP_EOL . $body . '</pre>';
}
protected function renderNode(HatenaSyntax_Node $node)