| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -245,22 +245,19 @@ function RtfGenerator() { | |||
| 245 | 245 | if (li) | |
| 246 | 246 | level++; | |
| 247 | 247 | ||
| 248 | - var rtf = '\\pard'; | ||
| 249 | - rtf += '\\sa150\\sl300\\slmult1'; | ||
| 248 | + var rtf = '\\pard\\sa150\\sl300\\slmult1'; | ||
| 250 | 249 | if (level > 0) | |
| 251 | - rtf += '\\li' + (level * 240); | ||
| 250 | + rtf += `\\li${level * 240}`; | ||
| 252 | 251 | if (li) { | |
| 253 | - rtf += '\\tx' + (level) * 240; | ||
| 254 | - rtf += '\\fi-240'; | ||
| 252 | + rtf += `\\tx${level * 240}\\fi-240`; | ||
| 255 | 253 | } | |
| 256 | 254 | if (lic) | |
| 257 | 255 | rtf += '\\ri240'; | |
| 258 | 256 | if (!lic) | |
| 259 | 257 | rtf += '\\b'; | |
| 260 | 258 | if (li) | |
| 261 | - rtf += ' ' + li + '\\tab'; | ||
| 262 | - rtf += ' '; | ||
| 263 | - rtf += lines.map(rtfEscape).join('\\line '); | ||
| 259 | + rtf += ` ${li}\\tab`; | ||
| 260 | + rtf += ` ${lines.map(rtfEscape).join('\\line ')}`; | ||
| 264 | 261 | if (!lic) | |
| 265 | 262 | rtf += '\\b0'; | |
| 266 | 263 | rtf += '\\par\n'; | |
@@ -279,25 +276,25 @@ function RtfGenerator() { | |||
| 279 | 276 | function toHex(number, length) { | |
| 280 | 277 | var hex = (~~number).toString(16); | |
| 281 | 278 | while (hex.length < length) | |
| 282 | - hex = '0' + hex; | ||
| 279 | + hex = `0${hex}`; | ||
| 283 | 280 | return hex; | |
| 284 | 281 | } | |
| 285 | 282 | ||
| 286 | 283 | function rtfEscape(string) { | |
| 287 | 284 | return string | |
| 288 | 285 | .replace(/[\\{}]/g, function(m) { | |
| 289 | - return '\\' + m; | ||
| 286 | + return `\\${m}`; | ||
| 290 | 287 | }) | |
| 291 | 288 | .replace(/\t/g, function() { | |
| 292 | 289 | return '\\tab '; | |
| 293 | 290 | }) | |
| 294 | 291 | // eslint-disable-next-line no-control-regex | |
| 295 | 292 | .replace(/[\x00-\x1f\x7f-\xff]/g, function(m) { | |
| 296 | - return '\\\'' + toHex(m.charCodeAt(0), 2); | ||
| 293 | + return `\\'${toHex(m.charCodeAt(0), 2)}`; | ||
| 297 | 294 | }) | |
| 298 | 295 | .replace(/\ufeff/g, '') | |
| 299 | 296 | .replace(/[\u0100-\uffff]/g, function(m) { | |
| 300 | - return '\\u' + toHex(m.charCodeAt(0), 4) + '?'; | ||
| 297 | + return `\\u${toHex(m.charCodeAt(0), 4)}?`; | ||
| 301 | 298 | }); | |
| 302 | 299 | } | |
| 303 | 300 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments