1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
# Removing the prepended comma from Org mode example blocks
As mentioned in [http://orgmode.org/manual/Literal-examples.html](http://orgmode.org/manual/Literal-examples.html),
when at the beginning of the line there is either ",*" or ",#+"
this prepended comma should be removed before parsing.
(Fixes [https://github.com/bdewey/org-ruby/issues/50](https://github.com/bdewey/org-ruby/issues/50))
## Here the prepended comma will be removed.
```org
,* Hello
,** Goodbye
, *** Not a headline, but prepended comma still removed.
,* I am a headline
```
## Here the prepended comma is should not be removed.
```js
{
"one": 1
, "two": 2
, "three": 3
, "four": 4
}
```
## Here the prepended comma is also removed
Emacs Org mode implementation also removes it.
```ruby
text = <<TEXT
,#+TITLE: Prepended comma world
,* Hello world
More text here
TEXT
```
## Here the prepended comma will be remove for the `Hello world` headline
```org
, ,* Hi
,
, ,* This will be appended a comma
,* Hello world
,
```
## Here the prepended comma will be removed
```org
,#+TITLE: "Hello world"
```
## This will be rendered as normal
```org
,,,,,,,,,,,,,,,,,*Hello world
```
|