Remarkable plugin adds title
attribute on URL and image tags and download
attribute on URL if title
set to download
.
Via npm
npm install remarkable-seo --save-dev
Via Yarn
yarn add remarkable-seo --dev
import { Remarkable } from 'remarkable';
import remarkableSeo from 'remarkable-seo';
const md = new Remarkable();
const testString = `Add 'title' attribute on link and image where missing.
Links to test Title:
* [Example](http://example.com)
* [Google](https://google.com)
* [Facebook](https://facebook.com "Facebook page")
Attached images:
1. ![Minion](https://octodex.github.com/images/minion.png)
1. ![Manufacturetocat](https://octodex.github.com/images/manufacturetocat.png)
1. ![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
`;
md.use(remarkableSeo);
console.log(md.render(testString));
const { Remarkable } = require('remarkable');
const remarkableSeo = require('remarkable-seo');
const md = new Remarkable();
const testString = `Add 'title' attribute on link and image where missing.
Links to test Title:
* [Example](http://example.com)
* [Google](https://google.com)
* [Facebook](https://facebook.com "Facebook page")
* [Download Minion](https://octodex.github.com/images/minion.png "download")
Attached images:
1. ![Minion](https://octodex.github.com/images/minion.png)
1. ![Manufacturetocat](https://octodex.github.com/images/manufacturetocat.png)
1. ![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
`;
md.use(remarkableSeo);
console.log(md.render(testString));
const remarkableSeo = require('remarkable-seo');
const siteConfig = {
...
markdownPlugins: [
function (md) {
remarkableSeo(md);
}
]
...
}