简体   繁体   中英

Pandoc/PowerShell option to use to avoid ​�? in place of the closing double quotes

I use the following Powershell script to convert the raw Markdown-Plain-Text in my clipboard into pastable things that can be used in an arbitrary browser. I use it most heavily for writing emails in Gmail, and for Google Docs.

paste.exe | pandoc -f markdown -t HTML |  Set-Clipboard -AsHtml ; echo 'Conversion done.' 

It has been working amazingly well, except for its conversion of the closing double quotes.

  • When I type, I do not distinguish between the Opening and the Closing quotation marks;
  • Either, it is pandoc that wanted to help, but screw up a bit,
  • Or, it is the Set-Clipboard Powershell command that needs a bit more of attention.

Experts, please advise what "magic flag" to put, so that I can avoid manually cleaning up the ? markers all over the place.

You can disable Pandoc's smart extension, which is enabled by default for markdown , latex , and context output.

pandoc -f markdown-smart -t HTML

Note that you "disable" an extension by appending -EXTENSION to the format, where EXTENSION is the extension name. Therefore the format is markdown-smart . Conversely you can enable an extension with +EXTENSION . So you might read markdown-smart as "markdown minus smart".

As an aside, the name smart is likely borrowed from SmartyPants , a postprocessor to the original Markdown implementation which replaces straight quotes with curly quotes among other things. I found the extension by opening the Pandoc User Guide and searching for smart . Now you know. ;-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM