diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-21 02:52:16 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-21 02:52:16 +0200 |
commit | a36f9abf1e0fd7de609dd1840d75bea56ec9e926 (patch) | |
tree | b14349d1a44df698533aa324f6c17d2922bb4b59 /tex/context/modules/mkiv/m-scite.mkiv | |
parent | af172a8db5f7583d0117635edde17eba5619d883 (diff) | |
download | context-a36f9abf1e0fd7de609dd1840d75bea56ec9e926.tar.gz |
2016-05-20 18:46:00
Diffstat (limited to 'tex/context/modules/mkiv/m-scite.mkiv')
-rw-r--r-- | tex/context/modules/mkiv/m-scite.mkiv | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv index e033235c3..fd4a3c7a1 100644 --- a/tex/context/modules/mkiv/m-scite.mkiv +++ b/tex/context/modules/mkiv/m-scite.mkiv @@ -62,6 +62,8 @@ local f_fore_bold = formatters["\\def\\slx%s#1{{\\slxc%s\\bf#1}}%%"] local f_none_bold = formatters["\\def\\slx%s#1{{\\bf#1}}%%"] local f_none_none = formatters["\\def\\slx%s#1{{#1}}%%"] local f_texstyled = formatters["\\slx%s{%s}"] +local f_hanging = formatters["\\slxb{%s}%s\\slxe"] + local f_mapping = [[ \let\string\slxL\string\letterleftbrace @@ -165,20 +167,21 @@ function scite.installcommands() context(exportcolors()) end -local p = lpeg.P("\\slxS ")^1 +local p1 = lpeg.tsplitat(lpeg.patterns.newline) +local p2 = lpeg.P("\\slxS ")^1 local function indent(str) - local l = string.split(str,"\n") + local l = lpegmatch(p1,str) for i=1,#l do local s = l[i] if #s > 0 then - local n = lpegmatch(p,s) + local n = lpegmatch(p2,s) if n then n = (n-1)/6 else n = 0 end - l[i] = formatters["\\slxb{%s}%s\\slxe"](n,s) + l[i] = f_hanging(n,s) end end return concat(l,"\n") |