wt-cgi-link-parser
TypeScript icon, indicating that this package has built-in type declarations

4.2.3 • Public • Published

Node.js CI

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

Readme

Keywords

none

Package Sidebar

Install

npm i wt-cgi-link-parser

Weekly Downloads

357

Version

4.2.3

License

ISC

Unpacked Size

1.9 MB

Total Files

113

Last publish

Collaborators

  • stanbienaives