File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 22-- with permission.
33-- Thanks, Norman, for these functions!
44
5+ -- The initial implementation was using "~", but we now sanitized the
6+ -- input earlier at parsing to replace those from the input with
7+ -- non-breaking spaces. So we can just use the non-breaking space
8+ -- character now on.
9+ local nbsp = luautf8 .char (0x00A0 )
10+
511local function find_outside_braces (str , pat , i )
612 -- local len = string.len(str)
713 local j , k = string.find (str , pat , i )
243249 -- <possibly adjust [[sep]] and [[ssep]] according to token position and size>=
244250 if not string.find (sep , sep_char ) then
245251 if i == lim - 1 then
246- sep , ssep = " ~ " , " ~ "
252+ sep , ssep = nbsp , nbsp
247253 elseif i == start + 1 then
248- sep = string.len (shortname ) < 3 and " ~ " or " "
249- ssep = string.len (longname ) < 3 and " ~ " or " "
254+ sep = string.len (shortname ) < 3 and nbsp or " "
255+ ssep = string.len (longname ) < 3 and nbsp or " "
250256 else
251257 sep , ssep = " " , " "
252258 end
You can’t perform that action at this time.
0 commit comments