{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"0.2.0","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"licenses":[{"type":"MIT","url":"https://github.com/jonschlinkert/gfm-code-block-regex/blob/master/LICENSE-MIT"}],"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha -R spec"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.2","verb":"^0.2.15"},"_id":"gfm-code-block-regex@0.2.0","_shasum":"35d7e1d62d3ee331247c97b6b4e127e8fc23dee3","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"35d7e1d62d3ee331247c97b6b4e127e8fc23dee3","tarball":"http://registry-npm.ywwl.com/gfm-code-block-regex/download/gfm-code-block-regex-0.2.0.tgz","integrity":"sha512-GWqUEn+lJVchNcN8EEEa1/b/iWbSEe2niyM4NE5C2wrZ3PAN6puoh6O8XKVZqnRawWQ4he+yPQS1Y+b8YLFiPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5THaS+cvvh9Xl2lcdjjr8rUOqWsjs6DdwhptPN4iUhQIhAJVdgOe+6WSGR4M7YmRR3Nz/Tq6RCH/11LfB3172DiKa"}],"size":3586,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.2.0.tgz"},"directories":{},"readme":"# gfm-code-block-regex [![NPM version](https://img.shields.io/npm/v/gfm-code-block-regex.svg?style=flat)](https://www.npmjs.com/package/gfm-code-block-regex) [![NPM monthly downloads](https://img.shields.io/npm/dm/gfm-code-block-regex.svg?style=flat)](https://npmjs.org/package/gfm-code-block-regex)  [![NPM total downloads](https://img.shields.io/npm/dt/gfm-code-block-regex.svg?style=flat)](https://npmjs.org/package/gfm-code-block-regex) [![Linux Build Status](https://img.shields.io/travis/regexhq/gfm-code-block-regex.svg?style=flat&label=Travis)](https://travis-ci.org/regexhq/gfm-code-block-regex)\n\n> RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save gfm-code-block-regex\n```\n\n## Usage\n\n```js\nvar re = require('gfm-code-block-regex');\n\nvar match = re().exec('random text \\n```js\\nfoo\\n```\\n more random text');\nconsole.log(match);\n```\n\nReturns:\n\n```js\n[ '```sh\\nnpm install micromatch --save-dev\\n```',\n  '```sh\\nnpm install micromatch --save-dev\\n```',\n  '```',\n  'sh',\n  '\\nnpm install micromatch --save-dev\\n',\n  '```',\n  index: 4,\n  input: 'foo\\n```sh\\nnpm install micromatch --save-dev\\n```\\nbar' ]\n```\n\n## Heads up!\n\nNote that if a gfm code block has a javascript block comment inside of it, and within the block comment is another gfm code block, it will fail if the block comment does not have leading stars.\n\n**Examples**\n\nThis should work:\n\n<pre>\n```js\n/**\n * This is a comment with\n * several lines of text.\n *\n * An example\n *\n * ```js\n * var foo = bar;\n * var foo = bar;\n * var foo = bar;\n * ```\n*/\n```\n</pre>\n\nThis will not work (note the absence of leading stars inside the comment):\n\n<pre>\n```js\n/**\n  This is a comment with\n  several lines of text.\n\n  An example\n\n  ```js\n  var foo = bar;\n  var foo = bar;\n  var foo = bar;\n  ```\n */\n```\n</pre>\n\nAlthough the previous example is perfectly valid, regex alone is not sufficient.\n\n## About\n### Related projects\n- [extract-gfm](https://www.npmjs.com/package/extract-gfm): Utilities for extracting and replacing GitHub Flavored Markdown code blocks. For example, you could easily… [more](https://github.com/jonschlinkert/extract-gfm) | [homepage](https://github.com/jonschlinkert/extract-gfm \"Utilities for extracting and replacing GitHub Flavored Markdown code blocks. For example, you could easily find code blocks for a specific language and run the code through a linter.\")\n- [gfm-code-blocks](https://www.npmjs.com/package/gfm-code-blocks): Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string. | [homepage](https://github.com/jonschlinkert/gfm-code-blocks \"Extract gfm (GitHub Flavored Markdown) fenced code blocks from a string.\")\n- [to-gfm-code-block](https://www.npmjs.com/package/to-gfm-code-block): Generate a github-flavored-markdown fenced-code-block snippet. | [homepage](https://github.com/jonschlinkert/to-gfm-code-block \"Generate a github-flavored-markdown fenced-code-block snippet.\")\n\n### Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n### Release history\n\n### Building docs\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n### Running tests\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 16, 2017._","publish_time":1411513688181,"_cnpm_publish_time":1411513688181,"dist-tags":{"latest":"1.0.0"}}