{"name":"gfm-code-block-regex","description":"RegExp for gfm (GitHub Flavored Markdown) fenced code blocks.","version":"0.2.3","homepage":"https://github.com/jonschlinkert/gfm-code-block-regex","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/gfm-code-block-regex.git"},"bugs":{"url":"https://github.com/jonschlinkert/gfm-code-block-regex/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"devDependencies":{"mocha":"*","test-helpers":"^0.1.4"},"keywords":["block","code","exec","expression","fence","fenced","fences","flavor","flavored","gfm","github","markdown","match","matches","pattern","patterns","re","regex","regexp","regular","replace","replacement"],"verb":{"plugins":["gulp-format-md"],"related":{"list":["to-gfm-code-block","extract-gfm","gfm-code-blocks"]}},"gitHead":"87bc0afe5d5d8e6862e7da066520aedc145b44bb","_id":"gfm-code-block-regex@0.2.3","_shasum":"0b9fe68acf2c5a5022fd6d2d418a634f6e97c110","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"0b9fe68acf2c5a5022fd6d2d418a634f6e97c110","tarball":"http://registry-npm.ywwl.com/gfm-code-block-regex/download/gfm-code-block-regex-0.2.3.tgz","integrity":"sha512-EWBtebD9AaCrS0/OU9eYDEDVsYCBCVIQXSsGlpAytPzy4jnEwPk+Io7hbNUnZJw4vMSt4hTnSl1fYmzq2Rv+Dg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvAhCDhf+fAZYowE9X51pQrmiyoqchkNOQhuWkiH/n9QIgMkNNOnSOPFed51zs6gGgqbJvBQZO2gmKGgVPbHzelKI="}],"size":2166,"noattachment":false,"key":"/gfm-code-block-regex/-/gfm-code-block-regex-0.2.3.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":1449663416202,"_cnpm_publish_time":1449663416202,"dist-tags":{"latest":"1.0.0"}}