From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/24860 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: A New Feature for Pandoc's Markdown Extension -- No Space with Newline Date: Tue, 14 Apr 2020 18:07:30 +0200 Message-ID: References: <20130715175101.GA20541@protagoras.phil.berkeley.edu> <51E56808.5000500@gmail.com> <35356bdb-9f45-4f0c-bb49-3fb4e2db98a0@googlegroups.com> <1beb6ec0-19a5-4da7-b785-ebb7d340c865@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003753c905a34266db" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="46191"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBT57272AKGQEP47JBCY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Apr 14 18:07:46 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f63.google.com ([209.85.208.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jOO6E-000Bn3-MM for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 14 Apr 2020 18:07:46 +0200 Original-Received: by mail-ed1-f63.google.com with SMTP id y66sf191903ede.19 for ; Tue, 14 Apr 2020 09:07:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586880466; cv=pass; d=google.com; s=arc-20160816; b=heK5qWLEkRGlOMwDLWWX3XNsg63uloZtJJjhN5hN0A9IZZakcR+9rJzCBt9nch/X9v HzqDeWm2HHfaR4uRRS5nqc4vQYFvLafHBwjzFfawbSJyss5ZcwBPiizBkG4IlW/j+t2i sJ6R51DqwPSYvTDVJSj7rSkN6SP2PmYNpq6BuA4x6xH2n+xTs2rehyKfYpwfNNF12vKX p+34vCg5J4JY+L6Uuv+ZkSlyq6fdTMohvJeDC4wW6xdKqGDTq4YZQ7hGJDYcuFd75scG xPhCwZmLiJFDblJMvjNB+qRxe6Nl0zRdl4nhdOBl+ds709onuKACd7rRRdON00xXhRYa 8Dkg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:sender:dkim-signature; bh=KCvAClg8dELoNiOS4kNGGmUUod9mHaMb+fP9kTRMme8=; b=LoGn/MkmovwuXUGsDEb+zCoyx2VTc7NGyQ2Q4qcDmoaGG3XndlLzd5xpSPOEpOWOxZ 0lol5O2CBR01RdB6fJIobIvdHnzja0ToEP68LWDGQ/T15ANTdGL2DcwIIRfNEvbn3ZpZ h9iw4NGjls1rn/H5tuh8M8YAZ25DyCYPEZf/ncUUg99a3WZHnk53uyJHsrcHucnwuJMc U1a5BYMY72Kn2tbrJeZkO/zp2CeW1ZNxgwTvUvZ0by+kj/wykIOaZG0HpyCwNJdzCVkO jmGUxFpKSUN3igymqMhqawxEqD/M7qysiAgzHr4Eq9C3Zz0OzBiDGpAAdSlc9ATach8f tYFA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.174 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:reply-to:from:date :message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=KCvAClg8dELoNiOS4kNGGmUUod9mHaMb+fP9kTRMme8=; b=oIhZWo+aaMuxwYf/db31pFKxA0ui9v58qg/vG/8OnhSyi3ogbXcb4w7vfVFVhGBakk WZ+b+fdgmpMLWe/iHxo+ezPFwIo21S3BU7BZrMmnf4gX3Y0+sLL7F+1habfWhJB4csUi 2WQFrHUxPvLE7DlhtjIM/JVE3MGPO6UKG4IgEmYmstJzEgraOuE+FQCEwXiIRpcpgMP/ M+08yFTVpl0yKps65eeIX/0wJeMjekhMzxLuM4YV2w+2zY+tulJEuSjkfWgnaSpijJbr b4/TgFY6OcnvXxN55/eMECNO1KZYxKCX68dYXL3lcUZ1XJFLhTEX0IEGp7vF7WXjMNM6 5E+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to :reply-to:from:date:message-id:subject:to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=KCvAClg8dELoNiOS4kNGGmUUod9mHaMb+fP9kTRMme8=; b=UnTGRLNRtj77APZuvenjRWgBqbWPMeUpQX2Fw5DMu3EPJN/aWdM/10/3Tj6OoA6Rva HWu06CQQ891noOZpOt09XoUk0jcvLKB7ZsKh7JjwsOOuCSRg2Jfml1713Hewf2/Y6K5H ihcC/VVF0a42uP8RqMvAc2Bvlr9+lZjnxRoobAyVnVOalw14zJOL+g61xEJlN01XGITh WcTBvgG3AMUzJaw+d6zY1CUScW9YP//OpVraPYnlQmCOfzBQpeUo33UgrzHH50ebus9k gqwj56FPr/E0BTfWFLd1ZrbVatrGIOqgYqAggEJ2RqRlY2hltrVmtEU7Q2rbK1C9+Taz 8VsQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AGi0PuaiS191loUwI0e0vtmGfXLC1Cy0OWJgSrIDTmSV+uYAcxthJWsX G+e2iRfmBgRCXV9jW09c9g4= X-Google-Smtp-Source: APiQypI4quzRsZVUM0Lj6CzoD/KW0z6xKbPSG8sHVd/6LahJhFKaCawi/rkMONiyf6KZnWEmJ8xqCw== X-Received: by 2002:a50:fc12:: with SMTP id i18mr18342346edr.337.1586880466296; Tue, 14 Apr 2020 09:07:46 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:906:6b89:: with SMTP id l9ls3126065ejr.6.gmail; Tue, 14 Apr 2020 09:07:43 -0700 (PDT) X-Received: by 2002:a17:906:c281:: with SMTP id r1mr874521ejz.310.1586880462702; Tue, 14 Apr 2020 09:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880462; cv=none; d=google.com; s=arc-20160816; b=NSdxCM3OmwdQaXikoQt3F1tBxw+B4bLNvZjSwAyC+K6VtAssbNuOqje8fTUanF/mVw 1gcKMASd12T0+ZD2lrlcfwTGvK2mS/8yY037ER9eEOIBto3qVNei2cCKFrba8IL5EbB9 pXOqB3vJNboVWjrFrjkFRvKeZZXWt/Nk39VcwLKmUvtakAwEU9FDG96iPMFzyCr12JM5 O9Yayqc9dnS6U/UrR4lkTl/NVhZgTuAtevrDenF8V+tj2fRurn0+u/Rb/Q90jfsbBBW0 TEEFR02ZdAMEr6++9HOxANwYB7pWNvnrhRakkQe3TAyds28l5BMsirE80yCnNSEeMfuN P4sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version; bh=yV8RRNrTMel5i9jQ73DvqSpJGNujMDrtbSuAF1jpEug=; b=w4HsmhX8IOQdOMRYvzIJAaIy8Sb42yYq2m62SH94vDMMhz/H4UJUrmklTbBHJLnFCA OGj4GGOvHuOLBj31CXiCXwItAPAgj/CLjq5Ri/8gbp/0FPnsxyvyPA+XJUET1i7UMD/C 9reJeEAya2ceiHLNXoDu9KvRbTX0/pePjZfvxATTEAukc13BnwpOcGCMpVBmKafexABX raRVmhpE4fE1v5vjghOTsY1iDqD89baT4zh92c4vuRschG6RVMloe/iMa12O2tOIXQBR C28th9LkIwCJCz901HqkCFuX+FU1pssXo8NKX8IuJdJbPsOh8Hdij70FnmHjgCriaWXd BkSg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.174 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Original-Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by gmr-mx.google.com with ESMTPS id f24si193619edw.3.2020.04.14.09.07.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Apr 2020 09:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.174 as permitted sender) client-ip=209.85.208.174; Original-Received: by mail-lj1-f174.google.com with SMTP id r7so323033ljg.13 for ; Tue, 14 Apr 2020 09:07:42 -0700 (PDT) X-Received: by 2002:a2e:710c:: with SMTP id m12mr583437ljc.60.1586880461623; Tue, 14 Apr 2020 09:07:41 -0700 (PDT) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 209.85.208.174 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:24860 Archived-At: --0000000000003753c905a34266db Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Are you conversant with perl and CPAN? If not what operating system(s) do you use (Windows/Mac/Linux)? I ask because if the answer to the first question is no I may have to guide you through installing some stuff, including perl itself if the answer to the second question is Windows. Den tis 14 apr. 2020 16:13J skrev: > Thank sounds perfect ! Many thanks for your efforts ! > > On Tuesday, April 14, 2020 at 1:18:17 PM UTC+8, BP wrote: >> >> A Perl filter which removes Space and SoftBreak elements sandwiched >> between two Str elements which respectively ends and starts with a >> character with Unicode script property CJK is certainly doable. Will tha= t >> be OK? >> >> /BPJ >> >> >> Den tis 14 apr. 2020 02:39J skrev: >> >>> Thank you for your efforts very much ! I wonder if the script can keep >>> the spaces inside English words, digits, and punctuation, since my file= s >>> also contain short groups of English words and number with digits ? >>> >>> On Tuesday, April 14, 2020 at 3:16:40 AM UTC+8, BP wrote: >>>> >>>> Wow that script is really ancient! I'll try to port it to a Lua filter >>>> tomorrow. It's 9 PM here now and I have been coding or writing for twe= lve >>>> hours, so I'm quite exhausted. >>>> >>>> Just to be clear, the old script removes all spaces which are next to = a >>>> "string" element, i.e. all "words", digits and punctuation alike, and = not >>>> just CJK characters. If you are OK with that behavior porting it to a = Lua >>>> filter will be trivial, and Lua is built-in in Pandoc. Otherwise I'll = have >>>> to look into rewriting the Perl script, which may be not quite as triv= ial. >>>> >>>> /BPJ >>>> >>>> Den m=C3=A5n 13 apr. 2020 20:45J skrev: >>>> >>>>> Could you help to update zapspace.pl to work with pandoc 2.9.2.1 ? I >>>>> have Chinese markdown files that use spaces to separate groups of wor= ds, >>>>> and would like to ignore spaces between Chinese characters before >>>>> converting to Word. >>>>> Many thanks ! >>>>> >>>>> On Tuesday, July 16, 2013 at 11:34:32 PM UTC+8, BP Jonsson wrote: >>>>>> >>>>>> 2013-07-15 19:51, John MacFarlane skrev: >>>>>> > +++ Bill Chen (CHEN, Zhechuan) [Jul 15 13 17:16 ]: >>>>>> >> Have found a way to make this feature done. >>>>>> >> Just add "\n" at the last of the line >>>>>> > >>>>>> > This would violate the general rule that backslashes before letter= s >>>>>> in >>>>>> > markdown are just literal backslashes. >>>>>> > >>>>>> > I think that a better approach would be to provide a markdown >>>>>> > extension like the current 'hard_line_breaks': perhaps >>>>>> > 'ignore_line_breaks'. 'hard_line_breaks' causes line >>>>>> > breaks in a paragraph to be interpreted as hard breaks; >>>>>> > 'ignore_line_breaks' would cause them to be ignored entirely. >>>>>> > (One of these would have to be designated as taking precedence >>>>>> > if both were selected.) >>>>>> > >>>>>> > John >>>>>> > >>>>>> >>>>>> The attached perl script, when used as a filter on pandoc's >>>>>> json output, should enable Bill to get what he wants. I have >>>>>> used an earlier version on Tibetan text with satisfactory >>>>>> results. Someone who knows Haskell could probably write >>>>>> something shorter which interacts with pandoc in a more >>>>>> elegant way, but this script works. >>>>>> >>>>>> The description inside the file reads as follows: >>>>>> >>>>>> FILE: zapspace.pl >>>>>> >>>>>> USAGE: pandoc -w json some.markdown | zapspace.pl | pandoc -r >>>>>> json >>>>>> >>>>>> DESCRIPTION: Takes as input a document in pandoc's json format and >>>>>> removes all "Space" elements inside any list which als= o >>>>>> contains any {"Str":"..."} element, and outputs a >>>>>> modified json document, which when given as input to >>>>>> pandoc will produce output suitable for languages whic= h >>>>>> don't put spaces between words or sentences, with no >>>>>> spaces >>>>>> inside paragraphs -- unless you insert non-breaking >>>>>> spaces, >>>>>> see below! --, and notably spaces caused by linebreaks >>>>>> in the markdown paragraph will be removed. >>>>>> >>>>>> Additionally it does two things which allow you to >>>>>> insert whitespace inside paragraph-like elements: >>>>>> >>>>>> 1) It replaces any non-breaking space (U+00A0) inside >>>>>> a >>>>>> "Str" element with ordinary soft spaces (U+0020) >>>>>> *if* the "Str" element also contains characters >>>>>> other >>>>>> than non-breaking spaces. >>>>>> >>>>>> This allows you to insert spaces into your markdow= n >>>>>> paragraphs as non-breaking spaces (in pandoc >>>>>> notation >>>>>> a backslash followed by an ordinary space "like\ >>>>>> this") >>>>>> and get ordinary spaces in your output. >>>>>> >>>>>> 2) Preserves any "Str" element which only contains on= e >>>>>> or more non-breaking spaces as is. >>>>>> >>>>>> This allows you to put non-breaking spaces between >>>>>> words by inserting ordinary whitespace -- which >>>>>> will >>>>>> be removed -- on either side of the non-breaking >>>>>> spaces "like \ this". >>>>>> ^ ^ >>>>>> >>>>>> N.B. that this is *not* done by scanning the JSON text >>>>>> with regular expressions! The JSON is loaded into a >>>>>> perl data structure which is modified and then >>>>>> converted >>>>>> back into JSON. Precautions are taken not to modify th= e >>>>>> structure such that the output will be rejected by >>>>>> pandoc, nor to modify code elements, but I can't >>>>>> guarantee >>>>>> that this will remain true with future versions of >>>>>> pandoc, >>>>>> or that it is true for any input. >>>>>> >>>>>> OPTIONS: --- >>>>>> REQUIREMENTS: * A reasonably recent version of perl. >>>>>> * The following CPAN modules: >>>>>> >>>>>> - [JSON::Any]( >>>>>> https://metacpan.org/module/JSON::Any) >>>>>> + A JSON 'backend' module like JSON or >>>>>> JSON::XS. >>>>>> - [List::MoreUtils]( >>>>>> https://metacpan.org/module/List::MoreUtils) >>>>>> - [autovivification]( >>>>>> https://metacpan.org/module/autovivification) >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "pandoc-discuss" group. >>>>> To unsubscribe from this group and stop receiving emails from it, sen= d >>>>> an email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/pandoc-discuss/35356bdb-9f45-4f0c-b= b49-3fb4e2db98a0%40googlegroups.com >>>>> >>>>> . >>>>> >>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "pandoc-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/pandoc-discuss/1beb6ec0-19a5-4da7-b78= 5-ebb7d340c865%40googlegroups.com >>> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/b3c84390-28d9-4962-909a-= 43eceab09108%40googlegroups.com > > . > --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CADAJKhC%2Bk%3DsdZVJV5GMKM9xZsP_L8KFGqny2f5AZQ6FDXngy6A%40ma= il.gmail.com. --0000000000003753c905a34266db Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Are you conversant with perl and CPAN?
I= f not what operating system(s) do you use (Windows/Mac/Linux)?

I ask because if the answer to the f= irst question is no I may have to guide you through installing some stuff, = including perl itself if the answer to the second question is Windows.

Den tis 14 apr. 2020 16:13J <lixi= chen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
Thank sounds perfect ! Many thanks for your efforts !=C2=A0
=
On Tuesday, April 14, 2020 at 1:18:17 PM UTC+8, BP wrote:
A Perl filter which removes Spa= ce and SoftBreak elements sandwiched between two Str elements which respect= ively ends and starts with a character with Unicode script property CJK is = certainly doable. Will that be OK?

/BPJ


Den tis 14 apr. 2020 02:39J <lixi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:
Thank you for your efforts very much ! I wonder if= the script can keep the spaces inside English words, digits, and punctuati= on, since my files also contain short groups of English words and number wi= th digits=C2=A0?

On Tuesday, April 14, 2020 at 3:16:40 AM UTC+8, BP = wrote:
Wow that sc= ript is really ancient! I'll try to port it to a Lua filter tomorrow. I= t's 9 PM here now and I have been coding or writing for twelve hours, s= o I'm quite exhausted.

Jus= t to be clear, the old script removes all spaces which are next to a "= string" element, i.e. all "words", digits and punctuation al= ike, and not just CJK characters. If you are OK with that behavior porting = it to a Lua filter will be trivial, and Lua is built-in in Pandoc. Otherwis= e I'll have to look into rewriting the Perl script, which may be not qu= ite as trivial.

/BPJ

Den m=C3=A5n 13 apr= . 2020 20:45J <lixi...@gmail.c= om> skrev:
= Could you help to update zapspace.pl to work with pandoc 2.9.2.1 ? I = have Chinese markdown files that use spaces to separate groups of words, an= d would like to ignore spaces between Chinese characters before converting = to Word.
Many thanks !=C2=A0

On Tuesday, July 16, 2013 at 11:34:= 32 PM UTC+8, BP Jonsson wrote:
2013-= 07-15 19:51, John MacFarlane skrev:
> +++ Bill Chen (CHEN, Zhechuan) [Jul 15 13 17:16 ]:
>> =C2=A0 =C2=A0 Have found a way to make this feature done.
>> =C2=A0 =C2=A0 Just add "\n" at the last of the line
>=20
> This would violate the general rule that backslashes before letter= s in
> markdown are just literal backslashes.
>=20
> I think that a better approach would be to provide a markdown
> extension like the current 'hard_line_breaks': =C2=A0perha= ps
> 'ignore_line_breaks'. =C2=A0'hard_line_breaks' cau= ses line
> breaks in a paragraph to be interpreted as hard breaks;
> 'ignore_line_breaks' would cause them to be ignored entire= ly.
> (One of these would have to be designated as taking precedence
> if both were selected.)
>=20
> John
>=20

The attached perl script, when used as a filter on pandoc's
json output, should enable Bill to get what he wants.=C2=A0 I have
used an earlier version on Tibetan text with satisfactory
results. Someone who knows Haskell could probably write
something shorter which interacts with pandoc in a more
elegant way, but this script works.

The description inside the file reads as follows:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 FILE: zapspace.pl

=C2=A0 =C2=A0 =C2=A0 =C2=A0USAGE: pandoc -w json some.markdown | zaps= pace.pl | pandoc -r json

=C2=A0DESCRIPTION: Takes as input a document in pandoc's json forma= t and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 removes all "Spac= e" elements inside any list which also
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 contains any {"St= r":"..."} element, and outputs a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 modified json document= , which when given as input to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pandoc will produce ou= tput suitable for languages which
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 don't put spaces b= etween words or sentences, with no spaces
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 inside paragraphs -- u= nless you insert non-breaking spaces,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 see below! --, and not= ably spaces caused by linebreaks
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 in the markdown paragr= aph will be removed.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Additionally it does t= wo things which allow you to
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 insert whitespace insi= de paragraph-like elements:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1) =C2=A0It replaces a= ny non-breaking space (U+00A0) inside a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "St= r" element with ordinary soft spaces (U+0020)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 *if* the= "Str" element also contains characters other
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 than non= -breaking spaces.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 This all= ows you to insert spaces into your markdown
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 paragrap= hs as non-breaking spaces (in pandoc notation
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 a backsl= ash followed by an ordinary space "like\ this")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 and get = ordinary spaces in your output.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 2) =C2=A0Preserves any= "Str" element which only contains one
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 or more = non-breaking spaces as is.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 This all= ows you to put non-breaking spaces between
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 words by= inserting ordinary whitespace -- which will
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 be remov= ed -- on either side of the non-breaking
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 spaces &= quot;like \ =C2=A0this".
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^ =C2=A0^

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 N.B. that this is *not= * done by scanning the JSON text
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 with regular expressio= ns!=C2=A0 The JSON is loaded into a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 perl data structure wh= ich is modified and then converted
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 back into JSON. Precau= tions are taken not to modify the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 structure such that th= e output will be rejected by
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pandoc, nor to modify = code elements, but I can't guarantee
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 that this will remain = true with future versions of pandoc,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 or that it is true for= any input.

=C2=A0 =C2=A0 =C2=A0OPTIONS: ---
REQUIREMENTS: * =C2=A0 A reasonably recent version of perl.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * =C2=A0 The following= CPAN modules:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - =C2=A0= [JSON::Any](https://metacpan.org/module/JSON::Any= )
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 + =C2=A0 A JSON 'backend' module like JSON or JSON::XS.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - =C2=A0= [List::MoreUtils](https://metacpan.org/module/L= ist::MoreUtils)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 - =C2=A0= [autovivification](https://metacpan.org/module= /autovivification)



--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-...@googlegroups.c= om.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3535= 6bdb-9f45-4f0c-bb49-3fb4e2db98a0%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1beb= 6ec0-19a5-4da7-b785-ebb7d340c865%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/b3c84390-28d9= -4962-909a-43eceab09108%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://gro= ups.google.com/d/msgid/pandoc-discuss/CADAJKhC%2Bk%3DsdZVJV5GMKM9xZsP_L8KFG= qny2f5AZQ6FDXngy6A%40mail.gmail.com.
--0000000000003753c905a34266db--