繁体   English   中英

使用 pod2html 生成带有自定义文本的 http 链接的正确语法是什么?

[英]What is the correct syntax for producing http links with custom text with pod2html?

perlpod文档告诉我,我可以使用L<scheme:...>L<text|scheme:...>链接到 URL,它甚至列出了L<The Perl Home Page|http://www.perl.org/>为例。

第一种情况对我来说很好用: pod2html变成了

L<http://example.com/>

进入

<a href="http://example.com/">http://example.com/</a>

但它失败了

L<example|http://example.com/>

刚刚变成

<em>example</em>

连同警告:

/usr/bin/pod2html: : cannot resolve L<example|http://example.com/> in paragraph 2.

我会期待类似的东西

<a href="http://example.com/">example</a>

要生产。 我怎样才能做到这一点?

更新因此,正如 Alan Haggai Alavi 指出的那样,这似乎是Pod::Html一个错误。 有解决方法吗?

这确实Pod::Html一个错误。 它已在 bleedperl 中修复。

现在L<example|http://example.com/>被转换为<a href="http://example.com/">example</a>

由于Pod::Html是一个纯 Perl 模块,因此可以从 bleadperl 复制文件,这将为您提供 1.12 版。 perl v5.14.2附带的模块是 1.11 版,并显示了此错误。

否则,您可以使用按预期工作的Pod::Simple::Html

像使用它一样

L<< example|http://example.com/ >>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM