4.4.89 • Published 10 months ago

@taktikorg/blanditiis-reiciendis v4.4.89

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@taktikorg/blanditiis-reiciendis

Buy me a coffee Downloads NPM version Build Coverage Status Repo Dependents

Ignore content display via HTML comments, Shown in GitHub readme, excluded in HTML.

Installation

This package is ESM only: Node 12+ is needed to use it and it must be import instead of require.

npm install @taktikorg/blanditiis-reiciendis

Options

export declare type RehypeIgnoreOptions = {
  /**
   *  Character to use for opening delimiter, by default `rehype:ignore:start`
   */
  openDelimiter?: string;
  /**
   * Character to use for closing delimiter, by default `rehype:ignore:end`
   */
  closeDelimiter?: string;
};

Usage

import { rehype } from 'rehype';
import rehypeIgnore from '@taktikorg/blanditiis-reiciendis';

rehype()
  .data('settings', { fragment: true })
  .use(rehypeIgnore, { })

HTML Example

<h1>header</h1>
<p>
  Hello <!--rehype:ignore:start--> <code>World</code> <!--rehype:ignore:end-->
</p>

Output:

<h1>header</h1>
<p>
  Hello </p>
import { rehype } from 'rehype';
import rehypeIgnore from '@taktikorg/blanditiis-reiciendis';

const html = `<h1>header</h1>
<p>
  Hello <!--rehype:ignore:start--> <code>World</code> <!--rehype:ignore:end-->
</p>`

const htmlStr = rehype()
  .data('settings', { fragment: true })
  .use(rehypeAttrs, { properties: 'attr' })
  .processSync(html)
  .toString()

Markdown Example

# Hello World

<!--rehype:ignore:start-->Hello World<!--rehype:ignore:end-->

Good!

Output:

<h1>Hello World</h1>

<p>Good!</p>
import { unified } from 'unified';
import rehypeIgnore from '@taktikorg/blanditiis-reiciendis';
import remarkParse from 'remark-parse';
import remark2rehype from 'remark-rehype';
import rehypeRaw from 'rehype-raw';
import stringify from 'rehype-stringify';

const html = `# Hello World

<!--rehype:ignore:start-->Hello World<!--rehype:ignore:end-->

Good!`

const htmlStr = unified()
  .use(remarkParse)
  .use(remark2rehype, { allowDangerousHtml: true })
  .use(rehypeRaw)
  .use(rehypeIgnore, { })
  .use(stringify)
  .processSync(html)
  .toString()

Related

Contributors

As always, thanks to our amazing contributors!

Made with action-contributors.

License

MIT © Kenny Wong

ECMAScript 2023environmentsurlserviceendpointaccessibilityfulluploaddominternal slotvaluenpmignoreeslintconfigiamargumentfnmatchcore-jsstartertrimsymboldiffsequenceanimationhelpersweakmapsignalcurlshellpostcsstrimStartcall-boundwritereduceECMAScript 5protocol-bufferstypedarrayseslintpluginincludes0owncryptdependency managerformattinggetoptroute53ponyfillelasticachepipegradients cssvaliddeep-cloneieserializationyamlArray.prototype.flatnameminimalmetadatalastpredictablestableparserjsRegExp.prototype.flagsasyncl10nInt16ArrayconfigurableschemareadablestringifierinterruptstypeerrorperformanthasOwntouchstylingcloudwatchecmascriptreact posehandlerstoolswalkpopmotionreact-hook-formsimpledbworkspace:*writableelbserializeebsArrayBuffer#sliceexpressassertformatpoint-freemodulesomitsameValueZeropackage managersetImmediatePushprogressTypeBoxMapreadablestreamutil.inspectObject.fromEntriestypedarrayspeedcommand-lineECMAScript 2022macosvalidateReactiveExtensionsarraybufferpolyfillObject.valuesgdprexecutegradients css3compareString.prototype.matchAllcachegroupawesomesaucesubprocessdataviewloadingstylecloudtrailsetArray.prototype.flatMapchromium_.extendURLsymlinksformes2017getintrinsicglacieruser-streamsfetchArrayrulesisConcatSpreadablebeanstalkcertificatesterminalarttrimLefttacitvaluessharedarraybufferstyled-componentstermexitassignresolvespinnerstranspilerwaapijson-schemaPromisejsonschematestbyteLengthString.prototype.trimcss variablefromfastrapidclispringdefinePropertyreact-hooksfixed-widthRegExp#flagslogclassnamesajaxec2function.lengthpinohot
4.4.89

10 months ago

4.4.88

10 months ago

4.4.87

10 months ago

4.4.86

10 months ago

4.4.85

10 months ago

4.4.84

11 months ago

4.4.83

11 months ago

4.4.82

11 months ago

4.4.81

11 months ago

4.4.80

11 months ago

4.4.79

11 months ago

4.4.78

11 months ago

4.4.77

11 months ago

4.4.76

11 months ago

4.4.75

11 months ago

4.4.74

11 months ago

4.4.73

11 months ago

4.4.72

11 months ago

4.4.71

11 months ago

4.4.70

11 months ago

4.4.69

11 months ago

4.4.68

11 months ago

4.3.68

11 months ago

4.3.67

11 months ago

3.3.67

11 months ago

3.3.66

11 months ago

3.3.65

11 months ago

3.3.64

11 months ago

3.3.63

11 months ago

3.3.62

11 months ago

3.3.61

11 months ago

3.3.60

11 months ago

3.3.59

11 months ago

3.3.58

11 months ago

3.3.57

11 months ago

3.3.56

12 months ago

3.3.55

12 months ago

3.3.54

12 months ago

3.3.53

12 months ago

3.3.52

12 months ago

3.2.52

12 months ago

3.2.51

12 months ago

3.2.50

12 months ago

2.2.50

12 months ago

2.2.49

12 months ago

2.2.48

12 months ago

2.2.47

12 months ago

2.2.46

12 months ago

2.2.45

12 months ago

2.2.44

12 months ago

2.2.43

12 months ago

2.2.42

12 months ago

2.2.41

12 months ago

2.2.40

12 months ago

2.2.39

12 months ago

2.2.38

1 year ago

2.2.37

1 year ago

2.2.36

1 year ago

2.2.35

1 year ago

2.2.34

1 year ago

2.2.33

1 year ago

2.2.32

1 year ago

2.2.31

1 year ago

2.1.31

1 year ago

2.1.30

1 year ago

2.1.29

1 year ago

2.0.29

1 year ago

2.0.28

1 year ago

2.0.27

1 year ago

2.0.26

1 year ago

2.0.25

1 year ago

2.0.24

1 year ago

2.0.23

1 year ago

2.0.22

1 year ago

2.0.21

1 year ago

2.0.20

1 year ago

2.0.19

1 year ago

2.0.18

1 year ago

2.0.17

1 year ago

2.0.16

1 year ago

2.0.15

1 year ago

2.0.14

1 year ago

2.0.13

1 year ago

2.0.12

1 year ago

2.0.11

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago