4.4.89 • Published 12 months ago

@taktikorg/blanditiis-reiciendis v4.4.89

Weekly downloads
-
License
MIT
Repository
github
Last release
12 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

12 months ago

4.4.88

12 months ago

4.4.87

12 months ago

4.4.86

12 months ago

4.4.85

12 months ago

4.4.84

12 months ago

4.4.83

12 months ago

4.4.82

1 year ago

4.4.81

1 year ago

4.4.80

1 year ago

4.4.79

1 year ago

4.4.78

1 year ago

4.4.77

1 year ago

4.4.76

1 year ago

4.4.75

1 year ago

4.4.74

1 year ago

4.4.73

1 year ago

4.4.72

1 year ago

4.4.71

1 year ago

4.4.70

1 year ago

4.4.69

1 year ago

4.4.68

1 year ago

4.3.68

1 year ago

4.3.67

1 year ago

3.3.67

1 year ago

3.3.66

1 year ago

3.3.65

1 year ago

3.3.64

1 year ago

3.3.63

1 year ago

3.3.62

1 year ago

3.3.61

1 year ago

3.3.60

1 year ago

3.3.59

1 year ago

3.3.58

1 year ago

3.3.57

1 year ago

3.3.56

1 year ago

3.3.55

1 year ago

3.3.54

1 year ago

3.3.53

1 year ago

3.3.52

1 year ago

3.2.52

1 year ago

3.2.51

1 year ago

3.2.50

1 year ago

2.2.50

1 year ago

2.2.49

1 year ago

2.2.48

1 year ago

2.2.47

1 year ago

2.2.46

1 year ago

2.2.45

1 year ago

2.2.44

1 year ago

2.2.43

1 year ago

2.2.42

1 year ago

2.2.41

1 year ago

2.2.40

1 year ago

2.2.39

1 year 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