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

Org-mode reader does not pass \nbsp to html #1657

Closed
slitvinov opened this issue Sep 29, 2014 · 4 comments · Fixed by #1706
Closed

Org-mode reader does not pass \nbsp to html #1657

slitvinov opened this issue Sep 29, 2014 · 4 comments · Fixed by #1706

Comments

@slitvinov
Copy link

With this file (nbsp.org):

\nbsp

I get

pandoc -t json -f org nbsp.org

[{"unMeta":{}},[{"t":"Para","c":[{"t":"RawInline","c":["latex","\\nbsp"]}]}]]

and \nbsp is missing in html output

pandoc -t html -f org def.org
<p></p>

This is a relevant section of org-mode manual.
http://orgmode.org/manual/Special-symbols.html

A list of special entities in org-mode with LaTeX, HTML, and ASCII
replacements.

@jgm
Copy link
Owner

jgm commented Oct 19, 2014

@tarleb, can you comment?

@tarleb
Copy link
Collaborator

tarleb commented Oct 20, 2014

Hi @slitvinov! Thanks for the report. The Org reader, in its current state, tries to parse word starting with a backslash \ as LaTeX – this handles most of what Emacs org-mode has to offer in terms of special symbols. The \nbsp symbol is a bastardization of HTMLs &nbsp; and is therfor not supported (yet).

You can work around this by using LaTeX syntax to input a non-breaking space: \ (backslash space) should do what you want.

As a side note / fun fact: Pandoc's LaTeX support is more complete than Emacs', giving Pandoc users more power at handling special symbols and LaTeX code: E.g. Converting \emph{Hello} to HTML will produce emphasized text in Pandoc, but remains a plain string when doing the same in Emacs. Also, rare symbols like \amalg (∐) or \doteq (≐) are not supported in Emacs.

@jgm
Copy link
Owner

jgm commented Oct 20, 2014

I'm not sure, but it seemed from the original report and linked web page
that org-mode has some special latex-ish codes that are meant to have
latex-independent meanings -- e.g., \nbsp should convert to any
format as a non-breaking space. Is this right, @slitvinov? If so,
maybe the org reader could use a lookup table to handle at least some
of these properly.

+++ Albert Krewinkel [Oct 20 14 10:16 ]:

Hi @slitvinov! Thanks for the report. The Org reader, in its current state, tries to parse word starting with a backslash \ as LaTeX – this handles most of what Emacs org-mode has to offer in terms of special symbols. The \nbsp symbol is a bastardization of HTMLs &nbsp; and is therfor not supported (yet).

You can work around this by using LaTeX syntax to input a non-breaking space: \ (backslash space) should do what you want.

As a side note / fun fact: Pandoc's LaTeX support is more complete than Emacs', giving Pandoc users more power at handling special symbols and LaTeX code: E.g. Converting \emph{Hello} to HTML will produce emphasized text in Pandoc, but remains a plain string when doing the same in Emacs. Also, rare symbols like \amalg (∐) or \doteq (≐) are not supported in Emacs.


Reply to this email directly or view it on GitHub:
#1657 (comment)

@tarleb
Copy link
Collaborator

tarleb commented Oct 20, 2014

Sorry, I wasn't clear in my answer. This is a bug in the org reader, and I actually started working on a fix.

tarleb added a commit to tarleb/pandoc that referenced this issue Oct 20, 2014
Org supports special symbols which can be included using LaTeX syntax.
Examples for this are `\nbsp` (a non-breaking space) and `\copy` (the
copyright sign ©).

This fixes jgm#1657.
tarleb added a commit to tarleb/pandoc that referenced this issue Oct 20, 2014
Org supports special symbols which can be included using LaTeX syntax.
Examples for this are `\nbsp` (a non-breaking space) and `\copy` (the
copyright sign ©).

This fixes jgm#1657.
tarleb added a commit to tarleb/pandoc that referenced this issue Oct 20, 2014
Org supports special symbols which can be included using LaTeX syntax,
but are actually MathML entities.  Examples for this are
`\nbsp` (non-breaking space), `\Aacute` (the letter A with accent acute)
or `\copy` (the copyright sign ©).

This fixes jgm#1657.
@jgm jgm closed this as completed in #1706 Oct 21, 2014
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

Successfully merging a pull request may close this issue.

3 participants