1
0
Fork 0

'\n' -> os.EOL

pull/1014/head
Rob Herley 2022-03-01 20:55:43 -05:00
parent 518ef1b79e
commit ac58d176ba
No known key found for this signature in database
GPG Key ID: D1602042C3543B06
1 changed files with 14 additions and 14 deletions

View File

@ -1,3 +1,4 @@
import {EOL} from 'os'
import {constants, promises} from 'fs' import {constants, promises} from 'fs'
const {access, appendFile, writeFile} = promises const {access, appendFile, writeFile} = promises
@ -105,16 +106,6 @@ export class MarkdownSummary {
return this return this
} }
/**
* Adds a newline to the summary buffer
*
* @returns {MarkdownSummary} markdown summary instance
*/
addNewline(): MarkdownSummary {
this.buffer += '\n'
return this
}
/** /**
* Adds raw text to the summary buffer * Adds raw text to the summary buffer
* *
@ -127,6 +118,15 @@ export class MarkdownSummary {
return this return this
} }
/**
* Adds the operating system-specific end-of-line marker to the buffer
*
* @returns {MarkdownSummary} markdown summary instance
*/
addEOL(): MarkdownSummary {
return this.add(EOL)
}
/** /**
* Adds an HTML codeblock to the summary buffer * Adds an HTML codeblock to the summary buffer
* *
@ -140,7 +140,7 @@ export class MarkdownSummary {
...(lang && {lang}) ...(lang && {lang})
} }
const element = this.wrap('pre', this.wrap('code', code), attrs) const element = this.wrap('pre', this.wrap('code', code), attrs)
return this.add(element).addNewline() return this.add(element).addEOL()
} }
/** /**
@ -155,7 +155,7 @@ export class MarkdownSummary {
const tag = ordered ? 'ol' : 'ul' const tag = ordered ? 'ol' : 'ul'
const listItems = items.map(item => this.wrap('li', item)).join('') const listItems = items.map(item => this.wrap('li', item)).join('')
const element = this.wrap(tag, listItems) const element = this.wrap(tag, listItems)
return this.add(element).addNewline() return this.add(element).addEOL()
} }
/** /**
@ -185,7 +185,7 @@ export class MarkdownSummary {
.join('') .join('')
const element = this.wrap('table', tableBody) const element = this.wrap('table', tableBody)
return this.add(element).addNewline() return this.add(element).addEOL()
} }
/** /**
@ -198,6 +198,6 @@ export class MarkdownSummary {
*/ */
addDetails(label: string, content: string): MarkdownSummary { addDetails(label: string, content: string): MarkdownSummary {
const element = this.wrap('details', this.wrap('summary', label) + content) const element = this.wrap('details', this.wrap('summary', label) + content)
return this.add(element).addNewline() return this.add(element).addEOL()
} }
} }