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

What controls the conversion of spaces to &npsb;? #202

Open
emacsomancer opened this issue Dec 19, 2024 · 1 comment
Open

What controls the conversion of spaces to &npsb;? #202

emacsomancer opened this issue Dec 19, 2024 · 1 comment

Comments

@emacsomancer
Copy link

emacsomancer commented Dec 19, 2024

When I send html email I seem to get all " " space characters of the original replaced by &npsb;, which messes up line-breaking in most clients.

What are the org-msg or org-mode-to-html settings which would be relevant here? I just want plain spaces in the email.

@emacsomancer
Copy link
Author

emacsomancer commented Dec 30, 2024

I've 'fixed' it locally by (re)defining within the use-package :config section:

    (defun org-msg-xml-to-str (xml) ;; REDEFINE to STOP NO PARAGRAPH BREAKING!!!
      "Convert the XML tree into a HTML string."
      (cond ((and (listp xml) (equal xml '(p nil " ")))
	     "<o:p> </o:p>")  ;; was <o:p>&nbsp;</o:p>
	    ((and (listp xml) (equal xml '(p nil)))
	     "<o:p>\n</o:p>")
	    ((stringp xml)
	     (replace-regexp-in-string " " " " ;; was replace-regexp-in-string " " "&nbsp;"
				       (org-msg-xml-escape-string xml)))
	    ((eq (car xml) 'comment)
	     (format "<!--%s-->" (caddr xml)))
	    ((eq (car xml) 'style)
	     (format "<style>%s</style>" (caddr xml)))
	    ((cddr xml)
	     (format "<%s%s>%s</%s>" (symbol-name (car xml))
		     (org-msg-attrs-str (cadr xml))
		     (apply 'concat (mapcar 'org-msg-xml-to-str (cddr xml)))
		     (symbol-name (car xml))))
	    ((format "<%s%s/>" (symbol-name (car xml))
		     (org-msg-attrs-str (cadr xml))))))

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

No branches or pull requests

1 participant