-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Leading tabs in code block are not retained in org reader with -p
#10071
Comments
Pandoc's behavior is consistent with that of the Emacs org-mode exporters as far as I can tell. Is there an Org-mode option that would allow to preserve tabs when exporting? |
Hi @tarleb as far as I know there is no org-export variable directly related to tab, but there is a variable called For the current example, I use org-export to do an org-to-org conversion. Emacs is run with
All tabs are retained. When
It replaces the leading tab with 8 white spaces, and add 2 spaces on both lines (the number of spaces depends on another variable). The other tabs are preserved. |
Interesting, thanks. If I understand correctly, then setting In principle, it should be enough to add the
However, it seems that the leading tab is currently lost and converted to a single space. I'm therefore re-adding the bug label. |
Thanks for your infomation, I was never aware of the capability to add this kind of flag to src block. I tried just now but didn't find any difference when exporting it. Did I miss something? $ cat example.org
#+begin_src makefile -i
%.o: %.cpp
$(CXX) -o $@ $<
#+end_src
$ pandoc -f org -t json -p example.org
{"pandoc-api-version":[1,23,1],"meta":{},"blocks":[{"t":"CodeBlock","c":[["",["makefile"],[]],"%.o: %.cpp\n $(CXX)\t-o\t$@\t$<\n"]}]} |
Exactly, that's the bug, and it should be fixed now. Please try the next nightly built, which should become available in about 15 hours. |
I will try then, thanks a lot for the quick fix! A remaining question is: is the
|
The |
Thanks for clarification, I understand now it is a orgmode src block flag rather than a pandoc one. I was only aware of head arguments starting with |
E.g. https://orgmode.org/manual/Literal-Examples.html |
Explain the problem.
I tried to convert an org-mode file to Markdown. When using pandoc with
-p
option to preserve the tabs in the Makefile source block, I found the leading tab is converted to single space while the other tabs remain unexpanded.Minimal example
There is a leading tab and tabs between entries in the directive. When converted to markdown with and without
-p
On the other hand, the markdown reader seems fine (I don't know how to make markdown block within a code block correctly rendered, so I added a comma before backticks)
Expected behavior
Pandoc version?
pandoc is installed using homebrew on macOS Sonoma
The text was updated successfully, but these errors were encountered: