forked from tools/josh
Properly escape symbols in useradd docs
This commit is contained in:
parent
d6d893d414
commit
93eecc6985
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "fwdekker.com",
|
||||
"version": "0.39.4",
|
||||
"version": "0.39.5",
|
||||
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
||||
"author": "Felix W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
|
|
@ -389,8 +389,8 @@ export enum ExitCode {
|
|||
}
|
||||
|
||||
|
||||
// An escaped newline escape symbol.
|
||||
const n = "\\\\\\";
|
||||
// An escaped newline escape symbol
|
||||
const n = "".trimMultiLinesSep + "".trimMultiLinesSep;
|
||||
|
||||
/**
|
||||
* Returns the script contents of the binaries in the `/bin` directory.
|
||||
|
@ -1067,7 +1067,7 @@ return new Command(
|
|||
\`Adds a user with the given data to the system.
|
||||
|
||||
The <u>name</u> must consist solely of alphanumerical characters.
|
||||
The <u>home</u> directory and the <u>description</u> must not contain the pipe character (') or the newline ${n}
|
||||
The <u>home</u> directory and the <u>description</u> must not contain the pipe character ('|') or the newline ${n}
|
||||
character ('\\\\n').
|
||||
|
||||
If no <u>home</u> is given, it defaults to "/home/<u>name</u>".\`.trimMultiLines(),
|
||||
|
|
|
@ -4,6 +4,8 @@ interface String {
|
|||
trimLines(): string;
|
||||
|
||||
trimMultiLines(): string;
|
||||
|
||||
trimMultiLinesSep: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,9 +39,14 @@ String.prototype.trimLines = function(): string {
|
|||
* split.
|
||||
*/
|
||||
String.prototype.trimMultiLines = function(): string {
|
||||
return this.trimLines().split("\\").map(it => it.trimLeft()).join("");
|
||||
return this.trimLines().split(this.trimMultiLinesSep).map(it => it.trimLeft()).join("");
|
||||
};
|
||||
|
||||
/**
|
||||
* The separator used in `#trimMultiLines`.
|
||||
*/
|
||||
String.prototype.trimMultiLinesSep = "\\\\\\";
|
||||
|
||||
|
||||
interface Array<T> {
|
||||
sortAlphabetically(transform: (element: T) => string, caseSensitive: boolean): T[];
|
||||
|
|
Loading…
Reference in New Issue