-
Notifications
You must be signed in to change notification settings - Fork 108
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
format-all make org export html coding error #197
Comments
I can also reproduce this bug. |
Is HTML Tidy messing up the file? Can you try I don't know why the org-mode exporter switches its output buffer to html-mode and runs the on-save hook. Seems oddly designed; these should be reserved for interactive use. |
Do it with
|
The macOS built-in tidy will mess up Chinese characters. |
I guess org-mode isn't writing a charset declaration into the HTML file, and Tidy assumes the wrong charset. I don't know what could cause the style to be corrupted. Anyway if I've understood the design of Emacs correctly, an internal process like org-mode's HTML writer should not write files using the user interface commands that run hooks and such. Instead, it should use a simple library function like The quick fix is to write a custom function for (add-hook
'prog-mode-hook
(lambda ()
(unless (and (buffer-file-name)
(file-exists-p
(concat (file-name-sans-extension (buffer-file-name))
".org")))
(format-all-mode)))) The long-term fix should be made to org-mode. Either rewrite the exporter not to use |
As running through exporting one file org, in which it has one Chinese character in Emacs 27.2 in the container of the docker ,which has I checked org export reference. sound like the export functions in |
It would not be hard for org-mode to do. Something like this (pseudo code):
|
Back-end job mostly like everything run in that |
emacs -q
and mini configuration as belowopen a file such as
foo.org
and write some Chinese character as belowThen,
C-c C-e h o
export org file to html , open the html file with browser and it display as below:If just
emacs -q
and exportfoo.org
tofoo.html
without mini configuration related to format-all, thefoo.html
displayed well.The text was updated successfully, but these errors were encountered: