wt-cgi-link-parser
v4.2.3
Published
Tool to parse links in the french law
Downloads
25
Readme
wisetax-link-parser
Parse link for french law tech
Legi links
Extract links
import { LEGI } from 'wt-cgi-link-parser';
const links = LEGI.extract(html, 'BOI');
// Links = ['LEGI:CGI:257', 'LEGI:CGI:257:bis',...]
Identify and Replace links
import { LEGI } from 'wt-cgi-link-parser';
const content = LEGI.replace(html, ({snatch, snippet}) => {
return `<a class='link' href='https://search.wisetax.fr/article#/${snatch}"})'> ${snippet} </span>`;
}, 'BOI')
// => content is the html replaces
Playground
A playground is available to experiment link detection
open playground/index.html
or online: https://stanbienaives.github.io/wisetax-link-parser/docs/index.html
Build playground to update:
cd playground && npm run build
Dev mode
cd playground && npm run dev