This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/remark-parse/lib/locate/emphasis.js
2020-11-01 22:46:04 +00:00

19 lines
333 B
JavaScript

'use strict'
module.exports = locate
function locate(value, fromIndex) {
var asterisk = value.indexOf('*', fromIndex)
var underscore = value.indexOf('_', fromIndex)
if (underscore === -1) {
return asterisk
}
if (asterisk === -1) {
return underscore
}
return underscore < asterisk ? underscore : asterisk
}