Josef-Friedrich / luakeys

LuaTeX package to parse key value options in Lua only, like keyval, kvsetkeys, kvoptions, xkeyval, pgfkeys but in Lua

Home Page:https://www.ctan.org/pkg/luakeys

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Treatment of spaces

kalekje opened this issue · comments

In my opinion, for this package, spaces should be left and right-stripped in strings, but preserved in between. I think this should be an option, at the very least. Just wanted to gauge your thoughts on this.

I think this is the behaviour in other markup languages https://yaml.org/spec/1.2.2/

For example:

luakeys.parse(' ke y1 = value one   , k e y 2 =valuetw o', {preserve_space=true}}  -- > {'ke y1'='value one','k e y 2'='valuetw o'}

It should be noted that spaces are stripped from values.
image

Here is a yaml example

He llo 2: wor ld  # comment
He llo1:         wor ld # comment

results in

{
  "He llo 2": "wor ld", 
  "He llo1": "wor ld"
}

I actually found out that this issue was caused on me end. It turns out that \@classoptionslist strips spaces automatically.