Socket
Socket
Sign inDemoInstall

icyphox.sh/grayfriday

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    icyphox.sh/grayfriday

Package blackfriday is a markdown processor. It translates plain text with simple formatting rules into an AST, which can then be further processed to HTML (provided by Blackfriday itself) or other formats (provided by the community). The simplest way to invoke Blackfriday is to call the Run function. It will take a text input and produce a text output in HTML (or other format). A slightly more sophisticated way to use Blackfriday is to create a Markdown processor and to call Parse, which returns a syntax tree for the input document. You can leverage Blackfriday's parsing for content extraction from markdown documents. You can assign a custom renderer and set various options to the Markdown processor. If you're interested in calling Blackfriday from command line, see https://github.com/russross/blackfriday-tool. Blackfriday includes an algorithm for creating sanitized anchor names corresponding to a given input text. This algorithm is used to create anchors for headings when AutoHeadingIDs extension is enabled. The algorithm is specified below, so that other packages can create compatible anchor names and links to those anchors. The algorithm iterates over the input text, interpreted as UTF-8, one Unicode code point (rune) at a time. All runes that are letters (category L) or numbers (category N) are considered valid characters. They are mapped to lower case, and included in the output. All other runes are considered invalid characters. Invalid characters that precede the first valid character, as well as invalid character that follow the last valid character are dropped completely. All other sequences of invalid characters between two valid characters are replaced with a single dash character '-'. SanitizedAnchorName exposes this functionality, and can be used to create compatible links to the anchor names generated by blackfriday. This algorithm is also implemented in a small standalone package at github.com/shurcooL/sanitized_anchor_name. It can be useful for clients that want a small package and don't need full functionality of blackfriday.


Version published

Readme

Source

grayfriday

A fork of github.com/russross/blackfriday/v2 with a few changes. Notably:

• Em-dashes swallow spaces. For example: "Foo -- bar" becomes "Foo—bar"
  This is more typographically accurate, while allowing for cleaner looking plaintext.
• En-dashes only between numbers. For example: "8-9 years" becomes "8ndash;9 years".
  Again, this keeps the plaintext more natural (as opposed to writing "8 - 9" years 
  in blackfriday for an en-dash).
• Optional image width/height. For example:
    ![foo image](http://example.com/bar.png){400x800}
  This renders as:
    <p><img src="http://example.com/bar.png" alt="foo style="width:400px; height:800px;" /></p>

INSTALL

go get git.icyphox.sh/grayfriday

LICENSE

Maintains the same license as blackfriday -- Simplified BSD.

FAQs

Last updated on 30 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc