powered by nequal
Home » HatenaSyntax » Timeline » 1640

Changeset 1640 -- 2010-02-10 13:13:34

Author
anatoo
Comment
fixed httplink parser failure

Diffs

HatenaSyntax/trunk/test/lib/HatenaSyntax/Locator.php

@@ -0,0 +1,10 @@
+<?php
+include_once dirname(__FILE__) . '/../../t.php';
+
+$t = new lime_test;
+
+$p = HatenaSyntax_Locator::it()->bracket;
+
+$c = PEG::context('[http://google.com:title=hoge]');
+
+$t->ok($p->parse($c));

HatenaSyntax/trunk/lib/HatenaSyntax/Locator.php

@@ -82,8 +82,8 @@
{
$title_char = PEG::subtract($this->lineChar, ']');
$title = PEG::choice(
-            PEG::second(':title', ''),
-            PEG::second(':title=', PEG::join(PEG::many1($title_char)))
+            PEG::second(':title=', PEG::join(PEG::many1($title_char))),
+            PEG::second(':title', '')
);
$url_char = PEG::subtract($this->lineChar, ']', ':title');