From: "krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <krulis.tomas.tk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Lua filter to insert non-breable spaces
Date: Wed, 30 Sep 2020 07:46:36 -0700 (PDT) [thread overview]
Message-ID: <25ebada0-19c5-4ec4-a282-274308ee6b74n@googlegroups.com> (raw)
In-Reply-To: <2e4fe1e0-39ce-438f-b2ec-fc57fd72cad0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2719 bytes --]
Thank you @BP , your solution works great too.
Now I can even choose from two correct </nbsp> representations ... !
Dne středa 30. září 2020 v 16:42:02 UTC+2 uživatel krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
napsal:
> Thank you very much, now everything works perfectly!
> I have to learn about Unicode and UTF-8 representations, since my main
> language (czech) uses them pretty heavily.
>
> I try to test and clean up the code a little (add more checks in
> `myCheckString` and do some renaming) and try to provide solution for some
> funny situations (test file kinda shows that:
>
> source:
>
> ```
> a\ i test
> ```
>
> compiles to native
>
> [Para [Str "a\160i",Space,Str "test"]
>
> But the correct solution should be
>
> [Para [Str "a\160i",Str "\160",Str "test"]
>
> I try to fix that.)
>
> However, since you have helped me a lot in creating this filter, and since
> I would take that as a "filter-quality assurence," I would like to offer
> this filter to be inluded in pandoc-lua-filters repository.
> Would it be ok?
>
> Regards, Tomas
>
> Dne středa 30. září 2020 v 16:30:05 UTC+2 uživatel Albert Krewinkel napsal:
>
>> Good to hear that things are (mostly) working!
>>
>> krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org writes:
>>
>> > Turn out, that I dont know how to change one element type to another.
>> If I
>> > use this filter, I get in `native pandoc` something like:
>> >
>> > [Para [Str "a\160i",Space,Str "test"]
>> > ,Para [Str "a",Str "\65533",Str "i",Str "\65533",Str "test"]]
>> >
>> > I have tryed few escapings, or set the type and content separately
>> like:
>> >
>> > inlines[i].t = 'Str'
>> > inlines[i].c = '\160'
>> >
>> > but to no avail (no change in the native output).
>> > I would like to ask you one more time for guidance (well, hopefully,
>> > afterwards I give myself a little break from lua).
>>
>> Right, I had missed that. Lua doesn't understand Haskell's syntax for
>> (Unicode) characters. We have to either use a literal nbsp character
>> ' ' or give the byte-wise UTF-8 representation of that char: '\xc2\xa0'
>>
>> Cheers!
>>
>>
>> --
>> Albert Krewinkel
>> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124
>>
>
--
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/25ebada0-19c5-4ec4-a282-274308ee6b74n%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 3944 bytes --]
next prev parent reply other threads:[~2020-09-30 14:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-30 12:40 krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
[not found] ` <62329746-0b8e-41f1-93d9-042398687631n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-30 13:32 ` Albert Krewinkel
[not found] ` <87k0wbjsov.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-09-30 14:10 ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
[not found] ` <3d7b4797-4d83-44fd-a65c-d612ab07a6dfn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-30 14:29 ` Albert Krewinkel
[not found] ` <87imbvjq1p.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2020-09-30 14:41 ` BPJ
[not found] ` <CADAJKhDgxv6fYrNrxog5ZkJdai16SpFnJiOFZ8RtLhReQDoghA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-09-30 14:44 ` Albert Krewinkel
2020-09-30 14:42 ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
[not found] ` <2e4fe1e0-39ce-438f-b2ec-fc57fd72cad0n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-30 14:46 ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [this message]
[not found] ` <25ebada0-19c5-4ec4-a282-274308ee6b74n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-30 14:49 ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
[not found] ` <e83f7a58-5718-4858-b536-e7b95de540a9n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2020-09-30 15:09 ` BPJ
[not found] ` <CADAJKhDh2zaKmuRKQYXRrf7MNOHrp-LkEEx2qoeV=oYPKb_Dzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-09-30 15:13 ` krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=25ebada0-19c5-4ec4-a282-274308ee6b74n@googlegroups.com \
--to=krulis.tomas.tk-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).