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

Make space prefix of body optional #16

Open
johanfforsberg opened this issue May 28, 2020 · 2 comments
Open

Make space prefix of body optional #16

johanfforsberg opened this issue May 28, 2020 · 2 comments

Comments

@johanfforsberg
Copy link

"inorganic.py" inserts a single space at the start of each line in a body. I guess this is intended to improve the readability of the raw org file. However, it interferes with use cases where I want to modify the org file and then convert it back to whatever the source format was.

In principle it would be possible to strip out the spaces at the beginning of lines before conversion, but that seems like something that would blow up sooner or later.

I propose to remove, or at least make the indentation optional. I configure org-mode to display headings to be displayed with indentation anyway, so the extra indentation does not help.

@karlicoss
Copy link
Owner

Hey, yeah, it happens in sanitize_body, and it's actually a poor version of escaping. E.g. otherwise if your selection contained '*' or '#' symbols, they would end starting a new outline.

I guess I wasn't sure if simply sanitizing * and # is enough.. Can you think of any other symbols to escape? I don't mind just doing it proprely and removing the whitespace thing :)

@johanfforsberg
Copy link
Author

I see, I didn't think of that!

It would be great though to not have to do this "carpet escaping". As far as I can tell from https://orgmode.org/worg/dev/org-syntax.html , mainly lines beginning with "* " and "#+" need escaping. Prefixing "* " lines with a space seems sensible.

But when I try in emacs, prefixing a "#+" line with spaces does not help, it still seems to be interpreted by emacs as a block. Same for ":drawers:" and "# comments". I can see this getting tricky!

Maybe another solution would be wrapping potentially problematic bodies in "#+begin_example" blocks or something, to prevent them from being interpreted..? Unfortunately that still has some issues. On https://orgmode.org/manual/Literal-Examples.html there are some examples where a leading comma is used for escaping, for some reason.

By the way, I really like orger, I think the idea has a lot of potential uses. Also the code is nice and readable!

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

2 participants