mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-26 10:48:40 +02:00
update cmd line
This commit is contained in:
parent
67a507d530
commit
8c55f6b749
214 changed files with 48553 additions and 48489 deletions
34
snippets/laravel-blade/src/services/BladeFormatter.ts
Normal file
34
snippets/laravel-blade/src/services/BladeFormatter.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
export class BladeFormatter
|
||||
{
|
||||
newLine: string = "\n";
|
||||
indentPattern: string;
|
||||
|
||||
constructor(options?: IBladeFormatterOptions) {
|
||||
options = options || {};
|
||||
|
||||
// options default value
|
||||
options.tabSize = options.tabSize || 4;
|
||||
if (typeof options.insertSpaces === "undefined") {
|
||||
options.insertSpaces = true;
|
||||
}
|
||||
|
||||
this.indentPattern = (options.insertSpaces) ? " ".repeat(options.tabSize) : "\t";
|
||||
}
|
||||
|
||||
format(inuptText: string): string {
|
||||
|
||||
let inComment: boolean = false;
|
||||
let output: string = inuptText;
|
||||
|
||||
// fix #57 url extra space after formatting
|
||||
output = output.replace(/url\(\"(\s*)/g, "url\(\"");
|
||||
|
||||
return output.trim();
|
||||
}
|
||||
}
|
||||
|
||||
export interface IBladeFormatterOptions
|
||||
{
|
||||
insertSpaces?: boolean;
|
||||
tabSize?: number;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue