Giter Club home page Giter Club logo

marky-markdown's Introduction

marky-markdown

Build Status Code Climate Dependency Status Pull Requests Issues Conventional Commits

marky-markdown is a markdown parser, written in NodeJS, that aims for parity with GitHub-style markdown. It is built on top of markdown-it, a CommonMark markdown parser. You can use marky-markdown:

marky-markdown is the thing that parses package READMEs on http://www.npmjs.com. If you see a markdown parsing bug there, file an issue here!

Node Version Support

marky-markdown strives to support all LTS, current, and maintenance versions of Node.js. When a version of Node.js is EOL, we will EOL support for that version for marky-markdown.

For more information on Node.js LTS and support, click here.

  • marky-markdown < 9.0.0 supports 0.10, 0.12, iojs, 4, 5
  • marky-markdown >= 9.0.0 supports 0.12, 4, 6

Installation

npm install marky-markdown --save

Programmatic Usage

marky-markdown exports a single function. For basic use, that function takes a single argument: a string to convert.

var marky = require("marky-markdown")
var html = marky("# hello, I'm markdown")

Options

The exported function takes an optional options object as its second argument:

marky("some trusted string", {sanitize: false})

The default options are as follows:

{
  sanitize: true,               // remove script tags and stuff
  nofollow: true,               // add rel=nofollow to all links
  linkify: true,                // turn orphan URLs into hyperlinks
  highlightSyntax: true,        // run highlights on fenced code blocks
  prefixHeadingIds: true,       // prevent DOM id collisions
  enableHeadingLinkIcons: true, // render icons inside generated section links
  serveImagesWithCDN: false,    // use npm's CDN to proxy images over HTTPS
  debug: false,                 // console.log() all the things
  package: null,                // npm package metadata,
  headingAnchorClass: 'anchor', // the classname used for anchors in headings.
  headingSvgClass: ['octicon']  // the class used for svg icon in headings.
}

Low Level Parser Access

If you need lower level access to the markdown-it parser (to add your own markdown-it plugins, for example), you can call the getParser method:

var parser = marky.getParser()
parser.use(someMarkdownItPlugin)
var html = parser.render("# markdown string")

getParser takes an optional options argument, the same format as the main marky-markdown export function. If you omit it, it uses the same default options described above.

When you're done customizing the parser, call parser.render(markdown) to render to HTML.

Command-line Usage

You can use marky-markdown to parse markdown files in the shell. The easiest way to do this is to install globally:

npm i -g marky-markdown
marky-markdown some.md > some.html

In the Browser

This module mostly works in the browser, with the exception of the highlights module.

You can require('marky-markdown') in scripts you browserify yourself, or just use the standalone file in [dist/marky-markdown.js].

Here is an example using HTML5 to render text inside <marky-markdown> tags.

<script src="marky-markdown.js"></script>

<marky-markdown>**Here** _is_ some [Markdown](https://github.com/)</marky-markdown>

<script>
  for (el of document.getElementsByTagName('marky-markdown')) {
    el.innerHTML = markyMarkdown(el.innerHTML, {highlightSyntax: false})
  }
</script>

Note: Usage with webpack requires that your webpack.config.js configure a loader (such as json-loader) for .json files. Also, you need to config process.browser in webpack.config.js when you target browser:

  plugins: [
    new webpack.DefinePlugin({
      'process.browser': true
    })
  ],

Tests

npm install
npm test

What it does

  • Parses markdown with markdown-it, a fast and commonmark-compliant parser.
  • Removes broken and malicious user input with sanitize-html
  • Applies syntax highlighting to GitHub-flavored code blocks using the highlights library from Atom.
  • Converts :emoji:-style shortcuts to unicode emojis.
  • Converts headings (h1, h2, etc) into anchored hyperlinks.
  • Converts relative GitHub links to their absolute equivalents.
  • Converts relative GitHub images sources to their GitHub raw equivalents.
  • Converts insecure Gravatar URLs to HTTPS.
  • Converts list items with leading [ ] and [x] into GitHub-style task lists
  • Wraps embedded YouTube videos so they can be styled.
  • Parses and sanitizes package.description as markdown.
  • Applies CSS classes to redundant content that closely matches npm package name and description.

npm packages

Pass in an npm package object to do stuff like rewriting relative URLs to their absolute equivalent on GitHub, normalizing package metadata with redundant readme content, etc

var package = {
  name: "foo",
  description: "foo is a thing",
  repository: {
    type: "git",
    url: "https://github.com/kung/foo"
  }
}

marky(
  "# hello, I am the foo readme",
  {package: package}
)

Dependencies

Extra syntax highlighting, in addition to what comes with highlights:

License

ISC

marky-markdown's People

Contributors

0xch4z avatar aearly avatar andreeleuterio avatar aredridel avatar ashleygwilliams avatar bakkerthehacker avatar bcoe avatar billiegoose avatar binhonglee avatar ceejbot avatar chenxsan avatar dominykas avatar eush77 avatar flet avatar greenkeeperio-bot avatar jamestautges avatar karanjthakkar avatar latentflip avatar patriciarealini avatar pouwerkerk avatar psalaets avatar revin avatar rreusser avatar seldo avatar sjking avatar soldair avatar styfle avatar tehshrike avatar zeke avatar zkat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marky-markdown's Issues

underline-style headings

Been trying to figure out why I see lines of equal signs among package descriptions, and realized this style of markdown heading is not currently supported (although it is on github).

Examples derived from the list of chokidar dependents. Arguably, the impact of this issue is worse on the list pages than the actual package description pages.

https://www.npmjs.com/package/fat-watchy
https://www.npmjs.com/package/madeye
https://www.npmjs.com/package/node-server-1412
https://www.npmjs.com/package/vsd
https://www.npmjs.com/package/quiver-file-component

Maybe a separate issue, but there are also still examples like this with the redundant heading:
https://www.npmjs.com/package/vmd

Handle headings without spaces after hashtags?

I've noticed this in a handful of packages on npm and it seems a bit weird and edge case-y, and confusing.

https://www.npmjs.com/package/subschema

Note how the headings aren't properly parsing because the Markdown seems to be a bit "incorrect" and missing a space after the ### and Install (and Example):

###Install
...
###Example You provide the schema and subschema renders it. Keeping the values, and errors in check.

GitHub is clever enough to parse the headings at https://github.com/jspears/subschema/blob/master/Readme.md but looks like [the excellently named] marky-markdown just ignores the sketchy Markdown. Sadly, the Markdown spec doesn't explicitly mention that there needs to be a space after the hashes, although the examples all use it. Amazingly, it looks like the reference Markdown dingus correctly converts the headings though: http://daringfireball.net/projects/markdown/dingus. But sadly it doesn't look like the Commonmark dingus does the same: http://spec.commonmark.org/dingus/, although the Commonmark spec is a lot clearer: http://spec.commonmark.org/0.17/#atx-headers

"The opening sequence of # characters cannot be followed directly by a non-space character."

Long story longer, should marky-markdown be handling apparently controversial edge cases like ###Install, or just give up and display the unparsed Markdown?

Ampersands in package descriptions are HTML encoded.

screen shot 2016-01-22 at 13 13 47

I'm not sure exactly where the problem lies, I found the following function in the website repository: https://github.com/npm/newww/blob/c4818328d5e936f359b587d340d8a3b821026672/presenters/package.js#L173

which led me to:

https://github.com/npm/marky-markdown/blob/master/lib/packagize.js#L48

There's a lot of conditional logic I'm not familiar with used here, but I'm assuming that at some point we return the description as-is, instead of un-encoding it and rendering it appropriately.

README parsing seems incorrect and content is not visible.

I have published the following package: https://www.npmjs.com/package/hubot-slack-relay and the README markdown does not seem to be parsed correctly and the content is not visible.

The html looks like this:

  <div id="readme" class="markdown">
      <h1 id="user-content-hubot-slack-relaya-script-to-relay-messages-from-a-local-channel-to-a-remote-channel-on-a-separate-slack-server-without-an-account-this-script-is-designedspecifically-for-use-with-hubot-and-the-slack-adapter-features-multiple-local-channels-can-relay-to-multiple-remote-channels-no-need-for-additional-bots-accounts-not-required-on-each-slack-server-installationnpm-install-hubot-slack-relaythen-add-hubot-slack-relay-to-external-scripts-json-commands-adding-relaysadds-a-relay-from-the-local-channel-to-the-remote-channel-the-remote-token-will-be-the-same-token-as-the-remote-hubot-slack-token-note-tokens-are-private-and-this-should-be-setup-via-direct-messaging-hubot-relay-add-local-channel-remote-channel-remote-token-remove-relaysremoves-relays-from-the-local-channel-specified-all-remote-channels-can-be-removed-or-single-remote-channels-can-be-removed-one-by-one-hubot-relay-remove-local-channel-remote-channel-list-relaysshow-all-existing-local-server-to-remote-server-relay-mappings-and-a-partial-token-listing-in-case-of-duplicates-hubot-relay-list" class="deep-link package-name-redundant"><a href="#hubot-slack-relaya-script-to-relay-messages-from-a-local-channel-to-a-remote-channel-on-a-separate-slack-server-without-an-account-this-script-is-designedspecifically-for-use-with-hubot-and-the-slack-adapter-features-multiple-local-channels-can-relay-to-multiple-remote-channels-no-need-for-additional-bots-accounts-not-required-on-each-slack-server-installationnpm-install-hubot-slack-relaythen-add-hubot-slack-relay-to-external-scripts-json-commands-adding-relaysadds-a-relay-from-the-local-channel-to-the-remote-channel-the-remote-token-will-be-the-same-token-as-the-remote-hubot-slack-token-note-tokens-are-private-and-this-should-be-setup-via-direct-messaging-hubot-relay-add-local-channel-remote-channel-remote-token-remove-relaysremoves-relays-from-the-local-channel-specified-all-remote-channels-can-be-removed-or-single-remote-channels-can-be-removed-one-by-one-hubot-relay-remove-local-channel-remote-channel-list-relaysshow-all-existing-local-server-to-remote-server-relay-mappings-and-a-partial-token-listing-in-case-of-duplicates-hubot-relay-list">Hubot Slack RelayA script to relay messages from a local channel to a remote channel on a separate slack server without an account. This script is designedspecifically for use with Hubot and the Slack adapter.## Features* Multiple local channels can relay to multiple remote channels* No need for additional bots* Accounts not required on each slack server## Installation<code>npm install hubot-slack-relay</code>Then add <code>&quot;hubot-slack-relay&quot;</code> to <code>external-scripts.json</code>## Commands### Adding RelaysAdds a relay from the local channel to the remote channel. The remote token will be the same token as the remote HUBOT_SLACK_TOKEN.<em>NOTE:</em> Tokens are private and this should be setup via Direct Messaging.<code>hubot relay add &lt;local-channel&gt; &lt;remote-channel&gt; &lt;remote-token&gt;</code>### Remove RelaysRemoves relays from the local channel specified. All remote channels can be removed or single remote channels can be removed one by one.<code>hubot relay remove &lt;local-channel&gt; [&lt;remote-channel&gt;]</code>### List RelaysShow all existing local server to remote server relay mappings and a partial token listing in case of duplicates.<code>hubot relay list</code></a></h1>

  </div>

superscript tags are stripped out

This is related specifically to superscript tags, but could be related to any other relative safe html tag. I ran into this in the documentation of currency.js (Github vs npm) where a superscript tag is being stripped out which leads to a fundamental difference in how the documentation is read.

Github:
github

npm:
npm

This seems like a relative safe tag to include, and it would be nice if npm could also match Github's whitelist of tags in order to have similar formats for readme documentations that are listed in both places.

zunda README.md crashes the parser

npmjs.com seems to have no problem showing the README from the zunda package:
https://www.npmjs.com/package/zunda

However, if I try to parse the file in that repo with marky-markdown, my node process pegs the cpu at 100% and the command never terminates.

// basically, i do this:
require("marky-markdown")(fs.readFileSync("README.md", { encoding: "utf-8" }))

Error during installation marky-markdown from npm

Hi, I got an error during installation marky-markdown. I noticed that an error is generated when installing the first-mate module. Here is the npm-debug.log

arkadiusz@arkadiusz-ThinkPad-X200:~/Projects/sealhub$ npm install marky-markdown --save
npm WARN package.json [email protected] No repository field.
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
-
> [email protected] install /home/arkadiusz/Projects/sealhub/node_modules/marky-markdown/node_modules/highlights/node_modules/first-mate/node_modules/oniguruma
> node-gyp rebuild

make: Entering directory `/home/arkadiusz/Projects/sealhub/node_modules/marky-markdown/node_modules/highlights/node_modules/first-mate/node_modules/oniguruma/build'
  CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regext.o
  CC(target) Release/obj.target/oniguruma/deps/onig/reggnu.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regparse.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposerr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regposix.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regsyntax.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regtrav.o
  CC(target) Release/obj.target/oniguruma/deps/onig/regversion.o
  CC(target) Release/obj.target/oniguruma/deps/onig/st.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/ascii.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/big5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/cp1251.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_jp.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_kr.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_tw.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/gb18030.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_1.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_2.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_3.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_4.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_5.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_6.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_7.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_9.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_10.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_11.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_13.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_14.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_15.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_16.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8_r.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/mktable.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/sjis.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/unicode.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_be.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_le.o
  CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf8.o
  AR(target) Release/obj.target/oniguruma.a
  COPY Release/oniguruma.a
  CXX(target) Release/obj.target/onig_scanner/src/onig-cache.o
In file included from ../src/onig-reg-exp.h:7:0,
                 from ../src/onig-cache.h:4,
                 from ../src/onig-cache.cc:1:
../node_modules/nan/nan.h:260:25: error: redefinition of ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)’
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
                         ^
../node_modules/nan/nan.h:255:25: error: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here
 NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
                         ^
../node_modules/nan/nan.h:660:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:660:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:664:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:664:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:671:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:671:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../src/onig-reg-exp.h:7,
                 from ../src/onig-cache.h:4,
                 from ../src/onig-cache.cc:1:
/home/arkadiusz/.node-gyp/4.0.0/src/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/arkadiusz/.node-gyp/4.0.0/src/node_buffer.h:31:40: note:   no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/arkadiusz/.node-gyp/4.0.0/src/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/arkadiusz/.node-gyp/4.0.0/src/node_buffer.h:43:40: note:   no known conversion for argument 2 from ‘const char*’ to ‘char*’
In file included from ../src/onig-reg-exp.h:7:0,
                 from ../src/onig-cache.h:4,
                 from ../src/onig-cache.cc:1:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:675:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:682:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
make: *** [Release/obj.target/onig_scanner/src/onig-cache.o] Error 1
make: Leaving directory `/home/arkadiusz/Projects/sealhub/node_modules/marky-markdown/node_modules/highlights/node_modules/first-mate/node_modules/oniguruma/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.13.0-22-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/arkadiusz/Projects/sealhub/node_modules/marky-markdown/node_modules/highlights/node_modules/first-mate/node_modules/oniguruma
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok 
npm ERR! Linux 3.13.0-22-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "marky-markdown" "--save"
npm ERR! node v4.0.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the oniguruma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls oniguruma
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/arkadiusz/Projects/sealhub/npm-debug.log

cut new minor version

waiting to merge #60

  • all up to date deps
  • supports iojs, 4, 5
  • github slugs
  • fully qualified links, link
  • lazy headers
  • diff syntax
  • emoji

this will be a fun one and maybe worth an announcement

Browserify SyntaxError: Unexpected character '�' (2:2)

When I try and use Marky-Markdown with Browserify I get the following error

>> SyntaxError: Unexpected character '�' (2:2) while parsing C:\Users\noahh_000
Noah\Programing\Polymer\Polymer-Markdown-Tag\node_modules\marky-markdown\node_m
dules\highlights\node_modules\first-mate\node_modules\oniguruma\build\Release\o
ig_scanner.node while parsing file: C:\Users\noahh_000\Noah\Programing\Polymer\
olymer-Markdown-Tag\node_modules\marky-markdown\node_modules\highlights\node_mo
ules\first-mate\node_modules\oniguruma\build\Release\onig_scanner.node

This appears to be an issue with a dependency of Marky-Markdown.

OS: Windows 8.1

Remove `pretty` from dependencies and do not prettify in CLI

  1. The only file that uses pretty is the CLI. The main stuff does not depend on it.
  2. It wraps the resulting HTML unconditionally, which means that the user can't opt out. So the CLI is rather a CLI for marky-markdown + pretty rather than for marky-markdown alone (which it should be).
  3. Prettifying can break things, because HTML is so space-sensitive. And it does (code blocks for example).
  4. It's not very unixy: if the user really wanted to prettify the output, she would pipe it to the CLI version of pretty or any other program. Combining programs in this way is more configurable and robust.

Missing word after README parsing on newww

I'm managing a package on npm: https://www.npmjs.com/package/glou.

As you can see on this page, the subtitle of the package is « Complete pipelining system compatible Gulp ». My problem is that in my markdown the subtitle is « Complete pipelining system compatible with Gulp » (there is « with » in the correct sentence but not on npm).

You can check this in the repository…

Handle CommonMark-incompliant multiline HTML comments without clobbering comments in code blocks

markdown-it freaks out on malformed/spec-incompliant multiline HTML comments:

A while back I added some code to marky-markdown that removed HTML comments from strings before passing them to the markdown-it parser. This solved the problem for the above-mentioned READMEs, but introduced new problems in other places. Some READMEs contain HTML comments within code blocks, and those should not be removed. For example:

There are at least two possible solutions to this:

  1. Figure out a way to remove HTML comments that aren't within a code block.
  2. Write a custom html_block function for markdown-it

Does not work with HapiJS 8.1.0

When I try to include marky-markdown in my HapiJS project then the application does not start up anymore. If I remove the require to marky then the application starts as normal.

Let me know what other info is needed.

`undefined` is stripped away

undefined tokens can't make it through sanitization phase.

$ cat m.md
```js
null==undefined
```
$ ./bin/marky-markdown.js m.md
<pre><code class="highlight js"><pre class="editor editor-colors"><div class="line"><span class="source js"><span class="constant language null js"><span>null</span> </span> <span class="keyword operator js"><span>==</span> </span> <span class="constant language js"><span></span> </span> </span> </div></pre>
</code>
</pre>

See it live: http://npm.im/gather

Allow plugins for markdown

I'd like to use some markdown-it plugins (hashtag, emoji, etc) but I don't see any easy way to sneak into the render function and modify the markdown-it instance it uses. Perhaps it could expose an option to pass in your own markdown-it instance?

all iframes are allowed

// Allow YouTube iframes
if (frame.tag !== 'iframe') return false
return !String(frame.attribs.src).match(/\/\/(www\.)?youtube\.com/)

The comment says that it allows only iframes from youtube. In fact, it allows iframes from anywhere, as long as the URL contains //youtube.com.

undefined in JS code

Hi, first thanks for porting markdown to npm!
It seems you do not print well 'undefined' identifier within javascript code listing (cf my project github/lachrist/aran).
Github:
github
Npm:
npm

Regards, Laurent

Emoji in headers is stripped from anchors

Hi! I've been poking at writing some documentation, and in the course of playing around with another tool I ran into a discrepancy between how GitHub generates heading slugs vs. how npm renders them, in particular when emoji appears in the header.

I've created a test repo and published it. It appears that npm strips emoji from the anchor entirely, while GitHub includes the emoji's GH nickname in the anchor.

This isn't blocking anything for me; this issue is by way of cataloguing the differences between GH's rendering and ours — apologies if this is a known thing. If so, please don't hesitate to close this out!

Thanks, all!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.