diff --git a/copyparty/cfg.py b/copyparty/cfg.py index af7d734f..c128b6c1 100644 --- a/copyparty/cfg.py +++ b/copyparty/cfg.py @@ -367,6 +367,8 @@ flagcats = { "epilogues=.epilogue.html": "files to embed below/after files", "readmes=readme.md,README.md": "files to embed as readmes", "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_logues": "disable embedding prologue/epilogue", "no_sb_md": "disable js sandbox for markdown files", diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9a12d680..331713db 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -4381,6 +4381,8 @@ class HttpCli(object): logues[n] = read_utf8(self.log, fsenc(fn), False) if "exp" in vn.flags: 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", "
") break readmes = ["", ""] @@ -4398,6 +4400,10 @@ class HttpCli(object): readmes[n] = read_utf8(self.log, fsenc(fn), False) if "exp" in vn.flags: readmes[n] = self._expand(readmes[n], vn.flags.get("exp_md") or []) + if "plainreadme" in vn.flags: + zs = html_escape(readmes[n]).replace("\n", "
") + logues[n] = "
%s
" % (zs,) + readmes[n] = "" break return logues, readmes diff --git a/copyparty/util.py b/copyparty/util.py index 8640ddea..e3d8cd43 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -444,6 +444,10 @@ IMPLICATIONS = [ ["no_logue", "no_logues"], # user-typo ["nologues", "no_logues"], # user-typo ["nologue", "no_logues"], # user-typo + ["plainlogue", "plainlogues"], # user-typo + ["plainreadmes", "plainreadme"], # user-typo + ["noscript", "plainlogues"], + ["noscript", "plainreadme"], ["sftpvv", "sftpv"], ["smbw", "smb"], ["smb1", "smb"],