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