Giter Club home page Giter Club logo

hexo-renderer-marked's Introduction

hexo-renderer-marked

Build Status NPM version Coverage Status NPM Dependencies NPM DevDependencies

Add support for Markdown. This plugin uses marked as its render engine.

Installation

$ npm install hexo-renderer-marked --save
  • Hexo 3: >= 0.2
  • Hexo 2: 0.1.x

Options

You can configure this plugin in _config.yml.

marked:
  gfm: true
  pedantic: false
  sanitize: false
  tables: true
  breaks: true
  smartLists: true
  smartypants: true
  modifyAnchors: ''
  autolink: true
  • gfm - Enables GitHub flavored markdown
  • pedantic - Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
  • sanitize - Sanitize the output. Ignore any HTML that has been input.
  • tables - Enable GFM tables. This option requires the gfm option to be true.
  • breaks - Enable GFM line breaks. This option requires the gfm option to be true.
  • smartLists - Use smarter list behavior than the original markdown.
  • smartypants - Use "smart" typograhic punctuation for things like quotes and dashes.
  • modifyAnchors - Use for transform anchorIds. if 1 to lowerCase and if 2 to upperCase.
  • autolink - Enable autolink for URLs. E.g. https://hexo.io will become <a href="https://hexo.io">https://hexo.io</a>.

Extras

Definition/Description Lists

hexo-renderer-marked also implements description/definition lists using the same syntax as PHP Markdown Extra.

This Markdown:

Definition Term
:    This is the definition for the term

will generate this html:

<dl>
  <dt>Definition Term</dt>
  <dd>This is the definition for the term</dd>
</dl>

Note: There is currently a limitation in this implementation. If multiple definitions are provided, the rendered HTML will be incorrect.

For example, this Markdown:

Definition Term
:    Definition 1
:    Definition 2

will generate this HTML:

<dl>
  <dt>Definition Term<br>: Definition 1</dt>
  <dd>Definition 2</dd>
</dl>

If you've got ideas on how to support multiple definitions, please provide a pull request. We'd love to support it.

hexo-renderer-marked's People

Contributors

tommy351 avatar noahdragon avatar dependabot-support avatar segayuu avatar cgmartin avatar jlhwung avatar ksky521 avatar hisaac avatar mathiasbynens avatar pashokus avatar rstoenescu avatar tomap avatar vhf avatar liuhongjiang avatar

Watchers

James Cloos avatar  avatar

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.