const github = 'https://github.com'

export default ({ version, excludes }) => {
  const excludeMatches = excludes
    .map(item => [`${github}/${item}/*`, `${github}/${item}?*`])
    .reduce((a, b) => a.concat(b))
  return {
    manifest_version: 2,
    name: 'GitHub Markdown Table of Contents',
    description: 'Show a table of contents of markdown on GitHub',
    version: version,
    author: 'otariidae',
    homepage_url: `${github}/otariidae/github-markdown-toc`,
    content_scripts: [
      {
        matches: [`${github}/*`],
        exclude_matches: excludeMatches,
        css: ['index.css'],
        js: ['index.js']
      }
    ],
    background: {
      scripts: ['background.js'],
      persistent: false
    },
    permissions: [`${github}/*`, 'contentSettings', 'tabs'],
    web_accessible_resources: ['spinner.svg', 'arrow-right.svg', 'arrow-left.svg', 'arrow-left-disabled.svg']
  }
}

@@ -815,16 +815,23 @@
 urces: %5B
+%0A      
 'spinner
@@ -832,24 +832,30 @@
 pinner.svg',
+%0A     
  'arrow-righ
@@ -857,24 +857,30 @@
 -right.svg',
+%0A     
  'arrow-left
@@ -885,16 +885,22 @@
 ft.svg',
+%0A     
  'arrow-
@@ -917,16 +917,21 @@
 led.svg'
+%0A    
 %5D%0A  %7D%0A%7D%0A

fix code style