-
Notifications
You must be signed in to change notification settings - Fork 131
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
Cyrillic text issue #300
Comments
Thanks for the report. I will figure out how to prevent doing this, may be using a new ox-hugo setting. |
I am thinking of the best way to solve this issue. The behavior that you see right now makes sense for Chinese. So I need to enable this behavior only if Chinese characters are detected.. thinking of how to do that in Elisp. I hope to have a solution in 2 days. |
@allarm As a quick workaround try putting this in your config and evaluate it: Below is the (with-eval-after-load 'ox-hugo
(defun org-hugo-paragraph (paragraph contents info)
"Transcode PARAGRAPH element into Hugo Markdown format.
CONTENTS is the paragraph contents. INFO is a plist used as a
communication channel."
(let (;; The label is mainly for paragraphs that are standalone
;; images with #+name keyword.
(label (let ((lbl (and (org-element-property :name paragraph)
(org-export-get-reference paragraph info))))
(if lbl
(format "<a id=\"%s\"></a>\n\n" lbl)
"")))
ret)
(unless (org-hugo--plist-get-true-p info :hugo-preserve-filling)
(setq contents (concat (mapconcat 'identity (split-string contents) " ") "\n")))
(setq contents (replace-regexp-in-string
;; Glue footnotes to the words before them using
;; so that the footnote reference does not
;; end up on a new line by itself.
;; "something FN" -> "something FN"
"[[:blank:]]+\\(\\[\\^[^]]+\\]\\)" " \\1"
(replace-regexp-in-string
;; "FN ." -> "FN."
"\\(\\[\\^[^]]+\\]\\)[[:blank:]]*\\([.]+\\)" "\\1\\2"
contents)))
;; (message "[org-hugo-paragraph DBG] para 3: %s" contents)
(setq ret (concat label
(org-md-paragraph paragraph contents info)))
;; Wrap the paragraph with HTML div tag with user-specified
;; attributes, unless the paragraph is a standalone image (or few
;; other conditions as shown below). These conditions are taken
;; from `org-html-paragraph'.
(let* ((parent (org-export-get-parent paragraph))
(parent-type (org-element-type parent)))
;; (message "[ox-hugo-para DBG] standalone image? %s\ncontents: %s"
;; (org-html-standalone-image-p paragraph info)
;; contents)
(unless (or
;; First paragraph in an item has no tag if it is alone
;; or followed, at most, by a sub-list.
(and (eq parent-type 'item)
(not (org-export-get-previous-element paragraph info))
(let ((followers (org-export-get-next-element paragraph info 2)))
(and (not (cdr followers))
(memq (org-element-type (car followers)) '(nil plain-list)))))
;; Standalone image.
(org-html-standalone-image-p paragraph info))
(setq ret (org-blackfriday--div-wrap-maybe paragraph ret))))
ret))) |
Hey @kaushalmodi, that worked, thanks a lot for quick turnaround, really appreciate it. Interestingly enough, the fact that I was the first Russian who reported this issue makes me (probably) the first Russian using If you need any help with troubleshooting any more Cyrillic - do let me know. And thank you for this wonderful package! |
@allarm Hello The workaround I suggested in my earlier post should not be needed any more. Please remove that workaround and update ox-hugo from Melpa. Feel free to report back any issues in this thread (even though it is closed). |
Nice, thanks a lot! |
Awesome, I can confirm that it is fixed. |
Actual Behavior
In the resulting markdown file lines stick together if they're written in Cyrillic letters. If the line ends on a punctuation mark it works as it should be.
Expected Behavior
Org file
should export to this markdown:
How to Reproduce the Issue
Try exporting the text from the example org file below.
Example Org File
Generated Markdown File or Error
Ox-Hugo Debug Information
Debug Info
Debug information for
ox-hugo
Emacs Version
Org Version
Hugo Version
Org
load-path
shadowsWarning: Possible mixed installation of Org
Study the output of
M-x list-load-path-shadows
.ox-hugo
defcustomsThe text was updated successfully, but these errors were encountered: