org-ruby icon indicating copy to clipboard operation
org-ruby copied to clipboard

Code strings: ~'hello world'~ rendered literally

Open ddoherty03 opened this issue 7 years ago • 4 comments

I would expect that ~'hello world'~ would render as 'hello world' but instead it gets rendered literally.

Without the single quotes rendering works correctly, but the single quotes seem to cause confusion.

I want to be able to describe a ruby string by putting it in code font, including the quotes, but this bug makes it impossible.

ddoherty03 avatar Nov 27 '17 12:11 ddoherty03

I have the same issue. I feel it's because these guys are adhering strictly to an org standard. I'm thinking of using a fork of this repo - patched, so my jeyll blog can render all kinds of inline snippets with quotes in them

oystersauce8 avatar Sep 27 '18 10:09 oystersauce8

@oystersauce8 Do you know where I can find more information about this behaviour/standard?

oskarkv avatar May 07 '21 15:05 oskarkv

I opened this issue, mainly so I could write Github README's with org-mode. Here is a transcript using the ~seeing-is-believing~ gem to demonstrate the issue:

require 'org-ruby'  # => true

# No delimiters
Orgmode::Parser.new("~hello, world~").to_textile  # => "p. @hello, world@\n"
# With single quotes, problems
Orgmode::Parser.new("~'hello, world'~").to_textile  # => "p. ~'hello, world'~\n"
# With double quotes, problems too
Orgmode::Parser.new("~\"hello, world\"~").to_textile  # => "p. ~\"hello, world\"~\n"
# But not with backquotes
Orgmode::Parser.new("~`hello, world`~").to_textile  # => "p. @`hello, world`@\n"
# Or parens
Orgmode::Parser.new("~(hello, world)~").to_textile  # => "p. @(hello, world)@\n"
# But delimitted string seem to work
Orgmode::Parser.new("~q(hello, world)~").to_textile  # => "p. @q(hello, world)@\n"
Orgmode::Parser.new("~Q(hello, world)~").to_textile  # => "p. @Q(hello, world)@\n"

So, it looks like something about the delimiters being ruby string delimiters. Hope that helps.

ddoherty03 avatar May 24 '21 16:05 ddoherty03

Sucks with lisp because ='symbol= renders literally.

8dcc avatar Apr 16 '23 17:04 8dcc