docs: function convertRelativeUrls(css, options, preservedTokens) {
  
      const pattern = /(url\s*\()\s*(["']?)/g
      const maxIndex = css.length - 1
      const sb = []
  
      let appendIndex = 0
      let match
  
      // Since we need to account for non-base64 data urls, we need to handle
      // ' and ) being part of the data string. Hence switching to indexOf,
      // to determine whether or not we have matching string terminators and
      // handling sb appends directly, instead of using matcher.append* methods.
  
      while ((match = pattern.exec(css)) !== null) {
  
          let startIndex = match.index + match[1].length  // 'url('.length()
          let terminator = match[2]         // ', " or empty (not quoted)
  
          if (terminator.length === 0) {
              terminator = ')'
          }
  
          let foundTerminator = false
  
          let endIndex = pattern.lastIndex - 1
  
          while (foundTerminator === false && endIndex + 1 <= maxIndex) {
              endIndex = css.indexOf(terminator, endIndex + 1)
  
              // endIndex == 0 doesn't really apply here
              if ((endIndex > 0) && (css.charAt(endIndex - 1) !== '\\')) {
                  foundTerminator = true
                  if (')' != terminator) {
                      endIndex = css.indexOf(')', endIndex)
                  }
              }
          }
  
          // Enough searching, start moving stuff over to the buffer
          sb.push(css.substring(appendIndex, match.index))
  
          if (foundTerminator) {
  
              let token = css.substring(startIndex, endIndex).replace(/(^\s*|\s*$)/g, '')
              if (token.slice(0, 19) !== ___PRESERVED_TOKEN_) {
  
                  if (terminator === "'" || terminator === '"') {
                      token = token.slice(1, -1)
                  } else if (terminator === ')') {
                      terminator = ''
                  }
  
                  let url
  
                  if (options.convertUrls && token.charAt(0) !== SEP && token.slice(0, 7) !== 'http://' && token.slice(0, 8) !== 'https://') {
  
                      // build path of detected urls
                      let target = options.target.slice()
  
                      token = token.split(SEP).join(PATH_SEP) // assuming urls in css use '/'
                      url = resolve(options.source.join(PATH_SEP), token).split(PATH_SEP)
  
                      let file = url.pop()
  
                      // remove common part of both paths
                      while (target[0] === url[0]) {
                          target.shift()
                          url.shift()
                      }
  
                      for (let i = 0, l = target.length; i < l; ++i) {
                          target[i] = '..'
                      }
                      url = terminator + [ ...target, ...url, file].join(SEP) + terminator
  
                  } else {
                      url = terminator + token + terminator
                  }
  
                  preservedTokens.push(url)
  
                  let preserver = 'url(' + ___PRESERVED_TOKEN_ + (preservedTokens.length - 1) + '___)'
                  sb.push(preserver)
  
              } else {
                  sb.push(`url(${token})`)
              }
  
              appendIndex = endIndex + 1
  
          } else {
              // No end terminator found, re-add the whole match. Should we throw/warn here?
              sb.push(css.substring(match.index, pattern.lastIndex))
              appendIndex = pattern.lastIndex
          }
      }
  
      sb.push(css.substring(appendIndex))
  
      return sb.join('')
  }