首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何防止RDoc解析URL?

如何防止RDoc解析URL?
EN

Stack Overflow用户
提问于 2011-01-13 10:18:44
回答 1查看 345关注 0票数 1

假设我有下面的类。

代码语言:javascript
复制
class Foo

  # I want the following to appear as-is in my documentation, not as an anchor tag. 
  #
  # http://www.google.com/
  #
  def bar
    puts "bar"
  end
end

然后我通过rdoc运行它。

$ rdoc foo.rb

它会生成以下代码:

代码语言:javascript
复制
<div class="method-description">
  <p>
    I want the following to appear as-is in my documentation, not as an anchor tag.
  </p>
  <p>
    <a href="http://www.google.com">www.google.com</a>/
  </p>
</div>

我想让它生成类似这样的东西:

代码语言:javascript
复制
<div class="method-description">
  <p>
    I want the following to appear as-is in my documentation, not as an anchor tag.
  </p>
  <p>
    http://www.google.com/
  </p>
</div>

实现这一目标的最佳方法是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-01-13 11:11:41

步骤1

确保您使用的是:

代码语言:javascript
复制
ruby 1.9.2
rdoc 2.5.8

步骤2

逃离它,你应该会好起来的。

代码语言:javascript
复制
class Foo

  # I want the following to appear as-is in my documentation, not as an anchor tag. 
  #
  # \http://www.google.com/
  #
  def bar
    puts "bar"
  end
end

输出:

代码语言:javascript
复制
<div class="method-description"> 
  <p>
    I want the following to appear as-is in my documentation, not as an anchor tag.
  </p>  
  <p>
    http://www.google.com/
  </p>
</div>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4676167

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档