mirror of
https://github.com/9001/copyparty.git
synced 2026-09-24 19:00:17 +01:00
plaintext readme/logue volflags
This commit is contained in:
@@ -367,6 +367,8 @@ flagcats = {
|
|||||||
"epilogues=.epilogue.html": "files to embed below/after files",
|
"epilogues=.epilogue.html": "files to embed below/after files",
|
||||||
"readmes=readme.md,README.md": "files to embed as readmes",
|
"readmes=readme.md,README.md": "files to embed as readmes",
|
||||||
"preadmes=preadme.md,PREADME.md": "files to embed as preadmes",
|
"preadmes=preadme.md,PREADME.md": "files to embed as preadmes",
|
||||||
|
"plainreadme": "embed readme/preadme as monospace plaintext",
|
||||||
|
"plainlogues": "embed prologue/epilogue as sans-serif plaintext",
|
||||||
"no_readme": "disable embedding readme/preadme",
|
"no_readme": "disable embedding readme/preadme",
|
||||||
"no_logues": "disable embedding prologue/epilogue",
|
"no_logues": "disable embedding prologue/epilogue",
|
||||||
"no_sb_md": "disable js sandbox for markdown files",
|
"no_sb_md": "disable js sandbox for markdown files",
|
||||||
|
|||||||
@@ -4381,6 +4381,8 @@ class HttpCli(object):
|
|||||||
logues[n] = read_utf8(self.log, fsenc(fn), False)
|
logues[n] = read_utf8(self.log, fsenc(fn), False)
|
||||||
if "exp" in vn.flags:
|
if "exp" in vn.flags:
|
||||||
logues[n] = self._expand(logues[n], vn.flags.get("exp_lg") or [])
|
logues[n] = self._expand(logues[n], vn.flags.get("exp_lg") or [])
|
||||||
|
if "plainlogues" in vn.flags:
|
||||||
|
logues[n] = html_escape(logues[n]).replace("\n", "<br />")
|
||||||
break
|
break
|
||||||
|
|
||||||
readmes = ["", ""]
|
readmes = ["", ""]
|
||||||
@@ -4398,6 +4400,10 @@ class HttpCli(object):
|
|||||||
readmes[n] = read_utf8(self.log, fsenc(fn), False)
|
readmes[n] = read_utf8(self.log, fsenc(fn), False)
|
||||||
if "exp" in vn.flags:
|
if "exp" in vn.flags:
|
||||||
readmes[n] = self._expand(readmes[n], vn.flags.get("exp_md") or [])
|
readmes[n] = self._expand(readmes[n], vn.flags.get("exp_md") or [])
|
||||||
|
if "plainreadme" in vn.flags:
|
||||||
|
zs = html_escape(readmes[n]).replace("\n", "<br />")
|
||||||
|
logues[n] = "<pre>%s</pre>" % (zs,)
|
||||||
|
readmes[n] = ""
|
||||||
break
|
break
|
||||||
|
|
||||||
return logues, readmes
|
return logues, readmes
|
||||||
|
|||||||
@@ -444,6 +444,10 @@ IMPLICATIONS = [
|
|||||||
["no_logue", "no_logues"], # user-typo
|
["no_logue", "no_logues"], # user-typo
|
||||||
["nologues", "no_logues"], # user-typo
|
["nologues", "no_logues"], # user-typo
|
||||||
["nologue", "no_logues"], # user-typo
|
["nologue", "no_logues"], # user-typo
|
||||||
|
["plainlogue", "plainlogues"], # user-typo
|
||||||
|
["plainreadmes", "plainreadme"], # user-typo
|
||||||
|
["noscript", "plainlogues"],
|
||||||
|
["noscript", "plainreadme"],
|
||||||
["sftpvv", "sftpv"],
|
["sftpvv", "sftpv"],
|
||||||
["smbw", "smb"],
|
["smbw", "smb"],
|
||||||
["smb1", "smb"],
|
["smb1", "smb"],
|
||||||
|
|||||||
Reference in New Issue
Block a user