Mylyn WikiText Textile 解析错误?

发布于 2024-12-23 13:25:42 字数 1307 浏览 4 评论 0原文

我正在致力于将 Java 博客平台的纺织插件从一个库 (textile4j) 迁移到 Mylyn 的 WikiText。到目前为止,非常有希望,但我有一些单元测试失败了:

public void testLinksSyntax44() {
    String in = "\"link text(with title)\":http://example.com/";
    String out = "<p><a href=\"http://example.com/\" title=\"with title\">link text</a></p>";
    textile.parse(in);
    String content = writer.toString();
    assertEquals(out, content);
}

public void testLinksSyntax46() {
    String in = "\"(link)link text(with title)\":http://example.com/";
    String out = "<p><a href=\"http://example.com/\" class=\"link\" title=\"with title\">link text</a></p>";
    textile.parse(in);
    String content = writer.toString();
    assertEquals(out, content);
}

基本上,输出显示 WikiText 解析 title 语法存在问题。每个测试的输出如下:

在 #44 中,输出为:

link text(with title)

在 #46 中,输出为:

链接文本(和title)

Textpattern Textile Web 小部件正确解析带有类和标题的链接 ("(link)link text(with title)":http://www .example.com/)和带标题的链接(“链接文本(带标题)”:http://www.example.com/)简短形式。

是我做错了什么,还是发现了bug?我仍在摸索这个库,但熟悉该库的人可能知道问题所在,可以找到错误,或者可以帮助纠正我。

非常感谢! 蒂姆

I'm working on migrating a textile plugin for a java blogging platform from one library (textile4j) to Mylyn's WikiText. So far very promising, but I have some unit tests that are failing:

public void testLinksSyntax44() {
    String in = "\"link text(with title)\":http://example.com/";
    String out = "<p><a href=\"http://example.com/\" title=\"with title\">link text</a></p>";
    textile.parse(in);
    String content = writer.toString();
    assertEquals(out, content);
}

public void testLinksSyntax46() {
    String in = "\"(link)link text(with title)\":http://example.com/";
    String out = "<p><a href=\"http://example.com/\" class=\"link\" title=\"with title\">link text</a></p>";
    textile.parse(in);
    String content = writer.toString();
    assertEquals(out, content);
}

Basically, the output is showing a problem with WikiText parsing the title syntax. The output for each test is as follows:

In #44, the output is: <p><a href="http://example.com/">link text(with title)</a></p>

In #46, the output is: <p><a href="http://example.com/" class="link">link text(with title)</a></p>

The Textpattern Textile web widget correctly parses the link with class and title ("(link)link text(with title)":http://www.example.com/) and the link with title ("link text(with title)":http://www.example.com/) short forms.

Am I doing something wrong, or did I find a bug? I'm still groking the library, but it might be that one familiar with the library knows the problem, can find the error, or can help correct me.

Much thanks!
Tim

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

杀お生予夺 2024-12-30 13:25:42

我发现该错误已被报告...

Eclipse Mylyn WikiText Bugzilla

I found that the bug has been reported...

Eclipse Mylyn WikiText Bugzilla

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文