0.0.4 • Published 2 years ago

@flaxpub/cleanlinks v0.0.4

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 years ago

Flax:plugin: printableLinks

Usage

Anyone who tried to print links got quickly lost into all those css breaking properties. And the output never got really be satisfying enough. But there is this amazing <wbr> element, the not known enough word break opportunity. This plugin is an attempt to simplify the use ot those elements.

Using a simple regex, it will allow line break at very specific places.

Install using npm

npm install @flaxpub/cleanlinks

Then, include it in your .eleventy.js config file:

const printableLinks = require("flax-printableLinks");

module.exports = (eleventyConfig) => {
  eleventyConfig.addPlugin(printableLinks);
};

You can then use this filter in your files:

{{ content | cleanLinks | safe }}

Config Options

OptionTypeDefault
selectorsstring'ahref^="http", ahref="www"'

Config Examples

The selectors accepts any selector that can be used in a js querySelector.

This example will run cleanLink on all the <blockquote> elements.

{{ content | cleanLinks('blockquote') | safe }}

Flax

Flax is a custom 11ty setup to publish book as website, as a screen output for a single source publishing system. Flax is developped by the folks at the Coko foundation

0.0.4

2 years ago

0.0.3

2 years ago