Question

Using RDoc markup and generating docs with Yard, I'm trying to document some command output that has a line like:

+----------------------------------+

...but can't figure out how to achieve this. How can I end up with HTML:

<pre class="code">
  +----------------------------------+
</pre>

I'm sure I missed something trivial in the docs...


Try #1

Without trying to escape the markup, I indent this 2 spaces (like any other code/pre block):

+----------------------------------+

...generate the docs, and get HTML (as expected, I suppose):

<pre class="code">
  <tt>----------------------------------</tt>
</pre>

Try #2

If I use a backslash to escape, this markup:

\+----------------------------------+

...becomes this HTML:

<pre class="code">
  \+----------------------------------+
</pre>

Try #3

Oddly enough, if I use two plus signs in succession, this markup:

++----------------------------------+

...becomes this HTML:

<pre class="code">
  ++----------------------------------+
</pre>

Try #4

Using unindented <tt> just leaves me with a non-"verbatim" (i.e. pre/code) section; just plain-text (again, as expected, I suppose):

<tt>+----------------------------------+</tt>

...becomes this HTML:

<p>
  <tt>-------------------------------------</tt>
</p>

Try #5

Using indented <tt> turns this markup:

<tt>+----------------------------------+</tt>

...into this HTML:

<pre class="code">
  <tt>+----------------------------------+</tt>
</pre>
Was it helpful?

Solution

This was a bug and fixed in yard: https://github.com/lsegal/yard/issues/403.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top