From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aCaAI9B3QWNLZgEAbAwnHQ (envelope-from ) for ; Sat, 08 Oct 2022 15:14:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uBKPI9B3QWO47gAA9RJhRA (envelope-from ) for ; Sat, 08 Oct 2022 15:14:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 371AB2BA90 for ; Sat, 8 Oct 2022 15:14:56 +0200 (CEST) Received: from localhost ([::1]:38072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oh9fK-00077u-S6 for larch@yhetil.org; Sat, 08 Oct 2022 09:14:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oh9ea-00077g-WB for emacs-orgmode@gnu.org; Sat, 08 Oct 2022 09:14:09 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:36801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oh9eZ-0005lj-1X for emacs-orgmode@gnu.org; Sat, 08 Oct 2022 09:14:08 -0400 Received: by mail-pl1-x62a.google.com with SMTP id c24so6806148plo.3 for ; Sat, 08 Oct 2022 06:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=NBIVu/lBmiKuFAewYXVlhvx6OhUaKJpdfwu944GbetY=; b=Q2I8M2prKZsWIYa5+BJKvAiuo+8EkVJ3nJHg67BfafoxhEtOZso/Dw1o/w+JJVhHoz SB1o7n/tu3jCpHtprNQwB6bf9hI3SqN0NvSU7uYo2DxnO5G0uHBdnnIi8mqe28mvcilW lval9LHXTiGc5pJbhhiI0k9/I6Pf9+JfnZgNlJy9piPr1dkpjvEa1udNXz6HdeG21Jaf qi3j7iact5JIr7hg/dvqW7cVn7FaXbWDkHyjNLVxEq7h15jjc55FUIX56jpR+xFJ72bq YSVGyh2glhQw6+C+VNiGiu9nzano2De+gpNMaGBvUIHeY68Mcr4VmkT/sdMo/5o0pzfI hrQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NBIVu/lBmiKuFAewYXVlhvx6OhUaKJpdfwu944GbetY=; b=e6P3rwwzZq7JYUo+gUJAiNgoVizM2pQcB5zKOJKb6QKnxb65FmY/NP3csZy9Nt7b+B AwxmMXIWrEilwm/h6K2vJ8Mc/iGORV16Ciswiosa75s+3zD/Nn6ypZ9blDfH2HPu79z5 vPsLAgy+HEAydD7ar22RPoMeIvS1UKSTPjlC2tZzT5krJKq1o41jywNjJjiMoe2W9xDG T+j5uiugDSQi9SmI0tZqG88Ki6fmpmpwzNbRE3zMXFEUNBKzI7zTGho+XXkmL6AYx2by MpHwXjxSCp6ExE3xBaNKlI9Zz3nlj1p5Vf4eD1xcEDoVaTiNDaA/pgCsAjLxJmrbX8Rh Uaag== X-Gm-Message-State: ACrzQf0/6s7kLCAufajxlPUnyzBr7EymNb/IDwCF3rBJLpguXplKOHjj pHGm4hF17AA/HVvRp8MNCAE= X-Google-Smtp-Source: AMsMyM5uPVH70mEXdrj0p83mGZFnUnOK3qIOGOpBCv2ki6jNq5uqvp5jvtem2O3FzmYcpD9DT2nE7g== X-Received: by 2002:a17:90b:2686:b0:20a:d838:25d2 with SMTP id pl6-20020a17090b268600b0020ad83825d2mr10612813pjb.35.1665234844990; Sat, 08 Oct 2022 06:14:04 -0700 (PDT) Received: from localhost ([2409:8970:af2:32f:6c23:3ad5:f37d:541b]) by smtp.gmail.com with ESMTPSA id z24-20020a17090acb1800b0020aa1bd91e4sm3038022pjt.4.2022.10.08.06.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 06:14:04 -0700 (PDT) From: Ihor Radchenko To: Maxim Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: Bug: ODT export of Chinese text inserts spaces for line breaks In-Reply-To: References: <17a55e0b01d.11be78c6c72761.7557666657037565597@zoho.com> <557d5f5d.2eed.17a56147ed0.Coremail.tumashu@163.com> <87sg10ttxw.fsf@ericabrahamsen.net> Date: Sat, 08 Oct 2022 21:14:55 +0800 Message-ID: <87wn9afods.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665234896; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=NBIVu/lBmiKuFAewYXVlhvx6OhUaKJpdfwu944GbetY=; b=peDQIhZhCx0sU9gWItjvYG4qsztON1AavrRpcsI2okq6xyBvOyb9gjjqoxNLkB5mhtMsj2 g8NliDHrO/oEnjopgPfYF9LqP4bL90jJjMSiTzrZ1fT1aKsISaHe9tTXBRiHygXsViaj+G oBeA+1WwuiCI5ExIPDnnEXdb31Jti6K0N+Ubkr3oF10vJvnybBFkqA1iBps5vHUnz3ytNg 0bk7uFlgQgONyY9S6M2E2KpcB5NqJp1m/xwsxlXuDp/xOir0FXT+U9sVxDDe+1mehL5qqa M1BAQxe5HIcpnKq+Cr4TEPojfc9VN6INs2j8tAsYtwVQ5+eifSACVM+R+iazFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665234896; a=rsa-sha256; cv=none; b=mVG5efHjuc/5oLR12CaoZPFfG2dmwQqBHTu/92qQCUX6hElHJcBCb4JTYPGstZzdlDrOgi 6mwaZ+OVpwl25bO30VkaaFTC5Uc3IZ/bgBjE1pPov+yJXPvQkmwgKgKKn3+csBQZ91kEVK Qap5tFeBf89ryjLkwx/M7IZzfYpccSj8nO4W18t00SHkjTVdGQrT4rEKdT33jDxOJRWBzL SgWdZlfjaL/I9YGlC2/gKlEvcIInZkQQGPRNcTC/q//jHfbM0ox7Zdypj6ui39l9spbEUS wKqpShSl5Twygw0U5fqwS9KxW63yeBxa8rxa2Fcf8uk9bvfGvU78n3ruUMQi4A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q2I8M2pr; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.08 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q2I8M2pr; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 371AB2BA90 X-Spam-Score: -8.08 X-Migadu-Scanner: scn0.migadu.com X-TUID: q8re7ksk3SVJ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 TWF4aW0gTmlrdWxpbiA8bWFuaWt1bGluQGdtYWlsLmNvbT4gd3JpdGVzOg0KDQo+IE9uIDI5LzA2 LzIwMjEgMTA6NDcsIEphbWVzIEhhcmtpbnMgd3JvdGU6DQo+PiAqIFRlc3QNCj4+IDHmnKzkurrk uI3mg7PkurLoh6rmi7/liLDlrabljoblrabkvY3or4HkuabjgIHmgKXkuo7nprvmoKHogIUs5Y+v 5Lmm6Z2i5aeU5omY5LuW5Lq65Luj6aKG5a2m5Y6G5a2m5L2N6K+BDQo+PiDkuaYsMjnml6Xotbfl jbPlj6/nprvmoKE7MuacrOS6uuaDs+S6suiHqumihuWPluWtpuWOhuWtpuS9jeivgeS5puiAhSzm jInlrabmoKHop4TlrprnmoTnqIvluo/lj4rmnInlhbMNCj4+IOimgeaxguWKnueQhuemu+agoeaJ i+e7rSzpooblj5bnm7jlhbPor4HkuablkI7nprvmoKE7DQo+DQo+PiBFeHBvcnRpbmcgdG8gT0RU IHByb2R1Y2VzIHRoZSBmb2xsb3d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WEuDQoNCj4gQXMgdG8gc3BsaWNpbmcgbGluZXMsIEkg Zm91bmQgYGZpbGwtZGVsZXRlLW5ld2xpbmVzJyB0aGF0IHVzZXMgDQo+IGBmaWxsLW5vc3BhY2Ut YmV0d2Vlbi13b3Jkcy10YWJsZScgYmVzaWRlcyA/fCBjYXRlZ29yeSB0byBkZXRlcm1pbmUgDQo+ IHdoZXRoZXIgc3BhY2Ugc2hvdWxkIGJlIHN1cHByZXNzZWQgd2hpbGUgc3BsaWNpbmcgbGluZXMu IEluIGFkZGl0aW9uIA0KPiB0aGVyZSBhcmUgc29tZSB2YXJpYWJsZXMgdG8gdHVuZSBiZWhhdmlv ci4NCg0KSSBhbSBhdHRhY2hpbmcgdGhlIGZpeCB0aGF0IGxldmVyYWdlcyBgZmlsbC1yZWdpb24n IHRvIGhhbmRsZSBhbGwgdGhlDQpjb21wbGV4aXRpZXMgZm9yIHVzLiBJdCBpcyB0aGUgZWFzaWVz dCB3YXkgYW5kIEkgc2VlIG5vIHJlYXNvbiB0byBsb29rDQpkZWVwZXIuDQoNCg== --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ox-odt-Fix-newlines-replaced-by-spaces-in-Han-script.patch >From 614944ba1ac5502c7648747363674b8d45bfaaf7 Mon Sep 17 00:00:00 2001 Message-Id: <614944ba1ac5502c7648747363674b8d45bfaaf7.1665234699.git.yantar92@gmail.com> From: Ihor Radchenko Date: Sat, 8 Oct 2022 21:08:47 +0800 Subject: [PATCH] ox-odt: Fix newlines replaced by spaces in Han script * lisp/ox-odt.el (org-odt-plain-text): Use `fill-region' to unfill the paragraphs with newlines accounting for scripts without spaces between words. Reported-by: James Harkins Link: https://orgmode.org/list/sbhnlv$4t1$1@ciao.gmane.io --- lisp/ox-odt.el | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index 208a39d9d..c989d2014 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2903,9 +2903,20 @@ (defun org-odt-plain-text (text info) (setq output (replace-regexp-in-string (car pair) (cdr pair) output t nil)))) ;; Handle break preservation if required. - (when (plist-get info :preserve-breaks) - (setq output (replace-regexp-in-string - "\\(\\\\\\\\\\)?[ \t]*\n" "" output t))) + (if (plist-get info :preserve-breaks) + (setq output (replace-regexp-in-string + "\\(\\\\\\\\\\)?[ \t]*\n" "" output t)) + ;; OpenDocument schema recognizes newlines as spaces, which may + ;; not be desired in scripts that do not separate words with + ;; spaces (for example, Han script). `fill-region' is able to + ;; handle such situations. + (setq output + (with-temp-buffer + (insert output) + ;; Unfill. + (let ((fill-column (point-max))) + (fill-region (point-min) (point-max))) + (buffer-string)))) ;; Return value. output)) -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--