Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
susam opened this issue May 11, 2023 · 1 comment

Comments

@susam
Copy link

susam commented May 11, 2023

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>
@susam
Copy link
Author

susam commented May 11, 2023

Here is a minimal demonstration that shows that the first three lines in the previous example are supposed to be rendered with <code> tags:

cat <<EOF > foo.org
* Demo
- =,foo=
- =, foo=
- =foo,=
EOF

pandoc foo.org -o foo.pandoc.html
grep '<li>' foo.pandoc.html
echo

emacs --batch \
      --eval "(find-file \"foo.org\")" \
      --eval "(org-export-to-file 'html \"foo.emacs.html\")" \
      --eval "(kill-emacs)"
grep '<li>' foo.emacs.html

Output:

<li><code class="verbatim">,foo</code></li>
<li><code class="verbatim">, foo</code></li>
<li><code class="verbatim">foo,</code></li>

<li><a href="#orgee10651">1. Demo</a></li>
<li><code>,foo</code></li>
<li><code>, foo</code></li>
<li><code>foo,</code></li>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant