Skip to content

Verbatim text with leading or trailing comma is not rendered with <code> tags #99

@susam

Description

@susam

Here is an example program that reproduces the issue:

require 'org-ruby'

# The following verbatim examples are not rendered using <code> tags.
# Both pandoc and org-export-to-file render them using <code> tags.
puts Orgmode::Parser.new("=,foo=").to_html
puts Orgmode::Parser.new("=, foo=").to_html
puts Orgmode::Parser.new("=foo,=").to_html
puts

# The above issue does not seem to occur if the comma is somewhere in
# the middle. These are correctly rendered with <code> tags.
puts Orgmode::Parser.new("=foo,bar=").to_html
puts Orgmode::Parser.new("=foo, bar=").to_html
puts

# The issue mentioned earlier does not seem to occur if we use another
# punctuation instead of comma. These are rendered with <code> tags too.
puts Orgmode::Parser.new("=;foo=").to_html
puts Orgmode::Parser.new("=; foo=").to_html
puts Orgmode::Parser.new("=foo;=").to_html
puts

puts Orgmode::Parser.new("=.foo=").to_html
puts Orgmode::Parser.new("=. foo=").to_html
puts Orgmode::Parser.new("=foo.=").to_html
puts

puts Orgmode::Parser.new("=:foo=").to_html
puts Orgmode::Parser.new("=: foo=").to_html
puts Orgmode::Parser.new("=foo:=").to_html
puts

puts Orgmode::Parser.new("=-foo=").to_html
puts Orgmode::Parser.new("=- foo=").to_html
puts Orgmode::Parser.new("=foo-=").to_html
puts

Here is the output:

<p>=,foo=</p>
<p>=, foo=</p>
<p>=foo,=</p>

<p><code>foo,bar</code></p>
<p><code>foo, bar</code></p>

<p><code>;foo</code></p>
<p><code>; foo</code></p>
<p><code>foo;</code></p>

<p><code>.foo</code></p>
<p><code>. foo</code></p>
<p><code>foo.</code></p>

<p><code>:foo</code></p>
<p><code>: foo</code></p>
<p><code>foo:</code></p>

<p><code>-foo</code></p>
<p><code>- foo</code></p>
<p><code>foo-</code></p>

However, the first three lines of output should be:

<p><code>=,foo=</code></p>
<p><code>=, foo=</code></p>
<p><code>=foo,=</code></p>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions