37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
['(SM)'] = '℠';
};
};
}
local quotes = {
[ss.str.enc.utf8] = {
['en'] = {'“', '”'; '‘', '’'};
['de'] = {'„', '“'; '‚', '‘'};
['sp'] = {'«', '»'; '‹', '›'};
['ja'] = {'「', '」'; '『', '』'};
['fr'] = {'« ', ' »'; '‹ ', ' ›'};
[true] = {'“', '”'; '‘', '’'};
};
}
local function meddle(ctx, t)
local pts = patterns[ctx.doc.enc]
if not pts then return t end
local str = ''
................................................................................
version = ss.version {0,1; 'devel'};
contributors = {{name='lexi hale', handle='velartrill', mail='lexi@hale.su', homepage='https://hale.su'}};
default = true; -- on unless inhibited
slow = true;
hook = {
doc_meddle_ast = function(job)
for n, sec in pairs(job.doc.secorder) do
if sec.kind=='ordinary' or sec.kind=='blockquote'
or sec.kind=='footnote' then
for i, block in pairs(sec.blocks) do
if type(block.spans) == 'table' then
enterspan(block.origin, block.spans)
elseif type(block.spans) == 'string' then
block.spans = meddle(block.origin, block.spans)
end
end
end
end
end;
};
}
|
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
['(SM)'] = '℠';
};
};
}
local quotes = {
[ss.str.enc.utf8] = {
-- 5 = elision char
['en'] = {'“', '”'; '‘', '’'; '’'};
['de'] = {'„', '“'; '‚', '‘'; '’'};
['sp'] = {'«', '»'; '‹', '›'; "’"};
['ja'] = {'「', '」'; '『', '』'; "'"};
['fr'] = {'« ',' »'; '‹ ',' ›'; "’"};
[true] = {'“', '”'; '‘', '’'; '’'};
};
}
local function meddle(ctx, t)
local pts = patterns[ctx.doc.enc]
if not pts then return t end
local str = ''
................................................................................
version = ss.version {0,1; 'devel'};
contributors = {{name='lexi hale', handle='velartrill', mail='lexi@hale.su', homepage='https://hale.su'}};
default = true; -- on unless inhibited
slow = true;
hook = {
doc_meddle_ast = function(job)
for n, sec in pairs(job.doc.secorder) do
if sec.kind=='ordinary' or sec.kind=='quote'
or sec.kind=='footnote' then
for i, block in pairs(sec.blocks) do
if type(block.spans) == 'table' then
enterspan(block.origin, block.spans)
elseif type(block.spans) == 'string' then
block.spans = meddle(block.origin, block.spans)
end
end
end
end
end;
};
}
|