I have an org-mode document with inline code formatting (text wrapped in ~). If the code starts with ', when I export to HTML the formatting doesn't get applied, and the ~s are printed literally. The syntax highlighting inside emacs also reflects that the formatting isn't being applied.

For example, this text:

Strict mode is enabled per scope with the ~'use strict';~ declaration at the very top of the scope.

Will be exported as-is, instead of removing the ~ around 'use strict;~ and rendering it as pre-formatted text.

Does anyone know how to get the proper formatting even when code formatting starts with a single quote?

1 Answer 1


I've used U+200B around inline source code to get around this problem before. It's not the prettiest solution to the problem, but it worked for me.

You can insert Unicode characters by their names (or code points) with C-x 8 RET.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.