mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 10:45:20 -04:00
Replace substr with slice
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e6ccc0e65e
commit
750a4233d3
4 changed files with 6 additions and 6 deletions
|
@ -46,8 +46,8 @@ export const parseBlockquoteExtraTag = (
|
|||
labelEndIndex,
|
||||
valueStartIndex,
|
||||
valueEndIndex,
|
||||
label: line.substr(labelStartIndex, labelEndIndex - labelStartIndex),
|
||||
value: line.substr(valueStartIndex, valueEndIndex - valueStartIndex)
|
||||
label: line.slice(labelStartIndex, labelEndIndex),
|
||||
value: line.slice(valueStartIndex, valueEndIndex)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ export class AnchorNodePreprocessor extends TravelerNodeProcessor {
|
|||
return
|
||||
}
|
||||
|
||||
const isJumpMark = url.substr(0, 1) === '#'
|
||||
const isJumpMark = url.slice(0, 1) === '#'
|
||||
|
||||
if (isJumpMark) {
|
||||
node.attribs['data-jump-target-id'] = url.substr(1)
|
||||
node.attribs['data-jump-target-id'] = url.slice(1)
|
||||
} else {
|
||||
node.attribs.rel = 'noreferer noopener'
|
||||
node.attribs.target = '_blank'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue