Skip to content

Commit

Permalink
replace last instance of String#slice with String#substring
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Aug 2, 2023
1 parent fa12258 commit 0a82230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ module.exports = function downdoc (asciidoc, { attributes: initialAttrs = {} } =
}
} else if (chr0 === '.') {
subs = NORMAL_SUBS
if (line !== chr0 && !(line[1] === '.' && line[2] === '.')) {
const text = line[1] === '*' && line[line.length - 1] === '*' ? line.slice(2, -1) : line.substring(1)
if (line !== chr0 && !(line[1] === '.' && line[2] === '.') && (match = line.length - 1)) {
const text = line[1] === '*' && line[match] === '*' ? line.substring(2, match) : line.substring(1)
blockTitle = (line = undefined) || { indent, text, subs }
}
} else if (indented) {
Expand Down

0 comments on commit 0a82230

Please sign in to comment.