obsidian-pandoc
obsidian-pandoc copied to clipboard
An unnecessary `Copy` is added to code blocks in Pandoc markdown export
The following Obisidian markdown:
Here's a code block:
```python
print("hello world")
```
Gets converted to the following Pandoc markdown. Note the addition of the unwanted word Copy
in the Pandoc code block:
Here\'s a code block:
``` {.language-python tabindex="0"}
print("hello world")
Copy
```
Also, is there a reason why the single quote character in here's
is getting escaped?
I am also having this issue.
Any resolution to this issue?
I was able to resolve this issue for myself. My markdown had the triple backtick code blocks like yours and when I used the Pandoc plugin to convert to DOCX, it generated the word "Copy" in monospace at the bottom of each code block.
- Workaround #1: Instead of the plugin, use the command line:
pandoc SRC.md -f markdown -t docx -s -o DEST.docx --reference-doc=TEMPLATE.docx
. This created the same exact output as the plugin but without the "Copy" and is my preferred workaround because it's a one-liner. There's a nice community plugin that lets you run shell commands like this within Obsidian via the command palette or a hotkey. - Workaround #2: Replace the triple backticks with an HTML
<pre></pre>
element. This is less desirable as you're moving away from the point of markdown, but it prevents the Pandoc plugin from generating "Copy" text for the code blocks.