Skip to content

Commit

Permalink
Add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aliariff committed Feb 11, 2024
1 parent 0069d36 commit 3576acd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/formatter/htmlbeautifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ export default class HtmlBeautifier {
return customEnvVar;
}

/**
* Handles the final newline of the result based on the configuration and the input.
* If the configuration is set to insert a final newline and the result does not end with a newline, it appends a newline.
* If the configuration is not set to insert a final newline, it follows the input's ending:
* - If the input ends with a newline and the result does not, it appends a newline.
* - If the input does not end with a newline and the result does, it removes the newline.
* @param {string} input - The original input string.
* @param {string} result - The result string to be processed.
* @returns {string} The processed result string.
*/
private handleFinalNewline(input: string, result: string): string {
const insertFinalNewline = vscode.workspace
.getConfiguration()
Expand Down

0 comments on commit 3576acd

Please sign in to comment.