Showing preview only (566K chars total). Download the full file or copy to clipboard to get everything.
Repository: contentful/rich-text
Branch: master
Commit: 1ebea53a99e6
Files: 160
Total size: 520.0 KB
Directory structure:
gitextract_d499cr83/
├── .circleci/
│ └── config.yml
├── .contentful/
│ ├── compressed-size.yml
│ └── vault-secrets.yaml
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github/
│ ├── dependabot.yml
│ ├── semantic.yml
│ └── workflows/
│ ├── auto-approve.yml
│ └── codeql.yml
├── .gitignore
├── .husky/
│ └── pre-commit
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .swcrc
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── baseJestConfig.js
├── catalog-info.yaml
├── commitlint.config.js
├── lerna.json
├── nx.json
├── package.json
├── packages/
│ ├── contentful-slatejs-adapter/
│ │ ├── .editorconfig
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── rollup.config.ts
│ │ ├── src/
│ │ │ ├── __test__/
│ │ │ │ ├── contentful-helpers.ts
│ │ │ │ └── contentful-to-slatejs-adapter.test.ts
│ │ │ ├── contentful-to-slatejs-adapter.ts
│ │ │ ├── helpers.ts
│ │ │ ├── index.ts
│ │ │ ├── schema.ts
│ │ │ ├── slatejs-to-contentful-adapter.ts
│ │ │ └── types/
│ │ │ ├── index.ts
│ │ │ └── slate.ts
│ │ └── tsconfig.json
│ ├── rich-text-from-markdown/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── rollup.config.js
│ │ ├── src/
│ │ │ ├── __test__/
│ │ │ │ ├── helpers.ts
│ │ │ │ ├── index.test.ts
│ │ │ │ ├── real-world.md
│ │ │ │ └── real-world.test.ts
│ │ │ ├── index.ts
│ │ │ └── types/
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── rich-text-html-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── rollup.config.js
│ │ ├── src/
│ │ │ ├── __test__/
│ │ │ │ ├── documents/
│ │ │ │ │ ├── embedded-entry.ts
│ │ │ │ │ ├── embedded-resource.ts
│ │ │ │ │ ├── heading.ts
│ │ │ │ │ ├── hr.ts
│ │ │ │ │ ├── hyperlink.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── inline-entity.ts
│ │ │ │ │ ├── invalid-marks.ts
│ │ │ │ │ ├── invalid-type.ts
│ │ │ │ │ ├── mark.ts
│ │ │ │ │ ├── ol.ts
│ │ │ │ │ ├── paragraph.ts
│ │ │ │ │ ├── quote.ts
│ │ │ │ │ ├── table-header.ts
│ │ │ │ │ ├── table.ts
│ │ │ │ │ └── ul.ts
│ │ │ │ └── index.test.ts
│ │ │ ├── escapeHtml.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── rich-text-links/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── rollup.config.js
│ │ ├── src/
│ │ │ ├── __test__/
│ │ │ │ └── index.test.ts
│ │ │ ├── index.ts
│ │ │ └── types/
│ │ │ └── utils.ts
│ │ └── tsconfig.json
│ ├── rich-text-plain-text-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── bin/
│ │ │ ├── benchmark/
│ │ │ │ └── get-rich-text-entity-links.ts
│ │ │ └── tsconfig.json
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── rollup.config.js
│ │ ├── src/
│ │ │ ├── __test__/
│ │ │ │ └── index.test.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── rich-text-react-renderer/
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── jest.config.js
│ │ ├── package.json
│ │ ├── rollup.config.js
│ │ ├── src/
│ │ │ ├── __test__/
│ │ │ │ ├── __snapshots__/
│ │ │ │ │ └── index.test.tsx.snap
│ │ │ │ ├── components/
│ │ │ │ │ ├── Document.tsx
│ │ │ │ │ ├── Paragraph.tsx
│ │ │ │ │ └── Strong.tsx
│ │ │ │ ├── documents/
│ │ │ │ │ ├── embedded-entry.ts
│ │ │ │ │ ├── embedded-resource.ts
│ │ │ │ │ ├── heading.ts
│ │ │ │ │ ├── hr.ts
│ │ │ │ │ ├── hyperlink.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── inline-entity.ts
│ │ │ │ │ ├── invalid-marks.ts
│ │ │ │ │ ├── invalid-type.ts
│ │ │ │ │ ├── mark.ts
│ │ │ │ │ ├── multi-mark.ts
│ │ │ │ │ ├── ol.ts
│ │ │ │ │ ├── paragraph.ts
│ │ │ │ │ ├── quote.ts
│ │ │ │ │ ├── table-header.ts
│ │ │ │ │ ├── table.ts
│ │ │ │ │ └── ul.ts
│ │ │ │ └── index.test.tsx
│ │ │ ├── index.tsx
│ │ │ └── util/
│ │ │ ├── appendKeyToValidElement.ts
│ │ │ └── nodeListToReactComponents.tsx
│ │ └── tsconfig.json
│ └── rich-text-types/
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── __mocks__/
│ │ └── @lingui/
│ │ └── core/
│ │ └── macro.js
│ ├── __test__/
│ │ ├── helpers.test.ts
│ │ ├── schemaConstraints.test.ts
│ │ └── validation.test.ts
│ ├── jest.config.js
│ ├── package.json
│ ├── scripts/
│ │ └── fix-esm-import-extensions.mjs
│ ├── src/
│ │ ├── blocks.ts
│ │ ├── emptyDocument.ts
│ │ ├── helpers.ts
│ │ ├── index.ts
│ │ ├── inlines.ts
│ │ ├── marks.ts
│ │ ├── nodeTypes.ts
│ │ ├── schemaConstraints.ts
│ │ ├── types.ts
│ │ └── validator/
│ │ ├── assert.ts
│ │ ├── errors.ts
│ │ ├── index.ts
│ │ ├── node.ts
│ │ ├── path.ts
│ │ ├── text.ts
│ │ └── types.ts
│ └── tsconfig.json
├── pnpm-workspace.yaml
├── renovate.json
├── rollup.config.js
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .circleci/config.yml
================================================
version: 2.1
orbs:
frontend-tools: contentful/frontend-tools@2
vault: contentful/vault@1.30.0
nx: nrwl/nx@1.6.2
executors:
default:
docker:
- image: cimg/node:24.13.1
cache-key: &cache-key
key: v2-npm-cache-{{ arch }}-{{ checksum ".nvmrc" }}-{{ checksum "pnpm-lock.yaml" }}-{{ .Branch }}
commands:
setup_pnpm:
steps:
- run:
name: Install pnpm package manager
command: |
sudo corepack enable
corepack prepare pnpm --activate
pnpm config set store-dir .pnpm-store
pnpm_install:
steps:
- restore_cache: *cache-key
- run: node -v
- run: pnpm -v
- run: pnpm install --frozen-lockfile --prefer-offline
- save_cache:
<<: *cache-key
paths:
- .pnpm-store
nx_set_shas:
steps:
- vault/get-secrets:
template-preset: nx-read-circleci
- nx/set-shas:
error-on-no-successful-workflow: true
main-branch-name: master
jobs:
lint-and-test:
executor: default
steps:
- checkout
- vault/get-secrets:
template-preset: packages-read
- setup_pnpm
- pnpm_install
- nx_set_shas
- run: pnpm exec nx affected --target=build --base=$NX_BASE --head=$NX_HEAD
- run: pnpm exec nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD
- run: pnpm exec nx affected --target=prettier:check --base=$NX_BASE --head=$NX_HEAD
- run: pnpm exec nx affected --target=test --base=$NX_BASE --head=$NX_HEAD
- store_test_results:
path: reports
- persist_to_workspace:
root: ~/project
paths:
- .
resource_class: medium+
release:
executor: default
steps:
- checkout
- vault/get-secrets:
template-preset: semantic-release
- attach_workspace:
at: ~/project
- vault/configure-lerna
- run: |
echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_WRITE_TOKEN}" >> ~/.npmrc
- run: pnpm nx run-many -t build
- run: pnpm lerna version --no-private --conventional-commits --create-release github --yes
- run: pnpm lerna publish from-git --yes
compressed-size:
executor: default
steps:
- checkout
- vault/get-secrets:
template-preset: packages-read
- vault/get-secrets:
template-preset: github-comment
- run: |
echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_READ_TOKEN}" >> ~/.npmrc
- frontend-tools/compressed-size:
package-manager: pnpm
workflows:
version: 2
# run on every commit
commit:
jobs:
- lint-and-test:
context:
- vault
- release:
context:
- vault
filters:
branches:
only: master
requires:
- lint-and-test
compressed-size:
jobs:
- compressed-size:
context:
- vault
================================================
FILE: .contentful/compressed-size.yml
================================================
version: 1
compressed-size:
compression: 'gzip'
pattern: './packages/*/{dist,build}/**/*.{js,css}'
strip-hash: "\\b\\w{8}\\."
collapse-unchanged: true
minimum-change-threshold: 1024
================================================
FILE: .contentful/vault-secrets.yaml
================================================
version: 1
services:
github-action:
policies:
- dependabot
circleci:
policies:
- github-comment
- semantic-release
- packages-read
- nx-read-circleci
================================================
FILE: .editorconfig
================================================
#root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
indent_size = 2
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .eslintignore
================================================
node_modules/
.coverage/
.cache/
dist/
.eslintrc.js
================================================
FILE: .eslintrc.js
================================================
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['react', 'react-hooks', '@typescript-eslint', 'eslint-plugin-import-helpers'],
rules: {
'react-hooks/exhaustive-deps': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'import-helpers/order-imports': [
'warn',
{
newlinesBetween: 'always',
groups: ['/^react/', 'module', ['parent', 'sibling', 'index']],
alphabetize: { order: 'asc', ignoreCase: true },
},
],
'no-restricted-imports': ['warn'],
'react/react-in-jsx-scope': 'off',
},
settings: {
react: { version: 'detect' },
},
};
================================================
FILE: .github/dependabot.yml
================================================
version: 2
registries:
npm-registry-registry-npmjs-org:
type: npm-registry
url: https://registry.npmjs.org
token: '${{secrets.NPM_REGISTRY_REGISTRY_NPMJS_ORG_TOKEN}}'
npm-github:
type: npm-registry
url: https://npm.pkg.github.com
token: ${{secrets.NPM_REGISTRY_REGISTRY_GH_ORG_TOKEN}}
updates:
- package-ecosystem: npm
directory: '/'
schedule:
interval: weekly
time: '00:00'
timezone: Etc/UCT
open-pull-requests-limit: 10
target-branch: master
labels:
- dependencies
- dependabot
commit-message:
prefix: chore
registries:
- npm-registry-registry-npmjs-org
- npm-github
reviewers:
- 'contentful/team-tolkien'
cooldown:
default-days: 15
================================================
FILE: .github/semantic.yml
================================================
titleAndCommits: true
anyCommit: true
allowMergeCommits: false
types:
- feat
- fix
- improvement
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
================================================
FILE: .github/workflows/auto-approve.yml
================================================
name: 'dependabot approve-and-request-merge'
on: pull_request_target
jobs:
worker:
permissions:
contents: write
id-token: write
pull-requests: write
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: contentful/github-auto-merge@v2
with:
VAULT_URL: ${{ secrets.VAULT_URL }}
================================================
FILE: .github/workflows/codeql.yml
================================================
---
name: "CodeQL Scan for GitHub Actions Workflow"
on:
push:
branches: [master]
paths: [".github/workflows/**"]
pull_request:
branches: [master]
paths: [".github/workflows/**"]
jobs:
analyze:
name: Analyze GitHub Actions workflows
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: actions
- name: Run CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: actions
================================================
FILE: .gitignore
================================================
# Logs
**/logs
**/*.log
**/npm-debug.log*
**/yarn-debug.log*
**/yarn-error.log*
# Coverage
**/coverage
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
**/build/Release
# Dependency directories
**/node_modules/
**/jspm_packages/
# TypeScript v1 declaration files
**/typings/
# Optional npm cache directory
**/.npm
# Optional eslint cache
**/.eslintcache
# Optional REPL history
**/.node_repl_history
# Output of 'npm pack'
**/*.tgz
# dotenv environment variables file
**/.env
**/dist
**/.rpt2_cache
.vscode/settings.json
.idea
# test reports
reports
# nx specific
.nx/
# swc
**/.swc
================================================
FILE: .husky/pre-commit
================================================
npx lint-staged
================================================
FILE: .npmrc
================================================
registry=https://registry.npmjs.org
ignore-scripts=true
shamefully-hoist=true
================================================
FILE: .nvmrc
================================================
v24
================================================
FILE: .prettierignore
================================================
**/node_modules
**/dist
**/coverage
================================================
FILE: .swcrc
================================================
{
"$schema": "https://swc.rs/schema.json",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"target": "es5",
"loose": false,
"minify": {
"compress": false,
"mangle": false
}
},
"module": {
"type": "commonjs"
},
"minify": false
}
================================================
FILE: CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [15.15.1](https://github.com/contentful/rich-text/compare/v15.15.0...v15.15.1) (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# [15.15.0](https://github.com/contentful/rich-text/compare/v15.14.1...v15.15.0) (2022-11-29)
### Bug Fixes
- don't run npm install on prePublish ([#417](https://github.com/contentful/rich-text/issues/417)) ([0af2378](https://github.com/contentful/rich-text/commit/0af237897ce093e294833e7e17c3b69e4634e09a))
### Features
- adding v1 marks to rich text types [TOL-786] ([#416](https://github.com/contentful/rich-text/issues/416)) ([8885de8](https://github.com/contentful/rich-text/commit/8885de8ebba7736de46b0b8892a8aa15bb8d7ba4))
## [15.14.1](https://github.com/contentful/rich-text/compare/v15.14.0...v15.14.1) (2022-11-23)
**Note:** Version bump only for package @contentful/rich-text
# [15.14.0](https://github.com/contentful/rich-text/compare/v15.13.2...v15.14.0) (2022-11-14)
### Features
- add super/sub script types ([#391](https://github.com/contentful/rich-text/issues/391)) ([2562f66](https://github.com/contentful/rich-text/commit/2562f66278f0eff4eeeb367025d4b465773893d1))
## [15.13.2](https://github.com/contentful/rich-text/compare/v15.13.1...v15.13.2) (2022-09-07)
### Bug Fixes
- add --no-package-lock ([#364](https://github.com/contentful/rich-text/issues/364)) ([41643c9](https://github.com/contentful/rich-text/commit/41643c9f61f525536941b54b64e944b70cb4a241))
- add inline sources to packages ([#357](https://github.com/contentful/rich-text/issues/357)) ([bca6abb](https://github.com/contentful/rich-text/commit/bca6abb4328414b5a7a87b9b57481e161d800dcf))
- add missing -- to circleci release commands ([#360](https://github.com/contentful/rich-text/issues/360)) ([233be08](https://github.com/contentful/rich-text/commit/233be0826cc7c76b799e70262b3281f7dbe4cd92))
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
- circleci update resource class ([#359](https://github.com/contentful/rich-text/issues/359)) ([6bb3710](https://github.com/contentful/rich-text/commit/6bb3710623907a2601c218f3cea3a817790cbf59))
- revert change to monorepo tsconfig, apply to tsconfig in rich-text-types ([#358](https://github.com/contentful/rich-text/issues/358)) ([56126cc](https://github.com/contentful/rich-text/commit/56126cc9ed3704f21b89d2dbded160be0265f153))
- update Lerna, rollup in slatejs-adapter ([#366](https://github.com/contentful/rich-text/issues/366)) ([32448e3](https://github.com/contentful/rich-text/commit/32448e369ae2b76601dd81839e13c15432430d68))
## [15.13.1](https://github.com/contentful/rich-text/compare/v15.13.0...v15.13.1) (2022-05-10)
### Bug Fixes
- **markdown:** handle empty table cells ([#329](https://github.com/contentful/rich-text/issues/329)) ([55a0a16](https://github.com/contentful/rich-text/commit/55a0a16a12700fefbe7e9727a7172043fd126fc5))
# [15.13.0](https://github.com/contentful/rich-text/compare/v15.12.1...v15.13.0) (2022-05-06)
### Features
- support converting tables from markdown to rich-text ([0abc0c6](https://github.com/contentful/rich-text/commit/0abc0c60b7e3e2683ebbb427b44847e6242f6e5e))
## [15.12.1](https://github.com/contentful/rich-text/compare/v15.12.0...v15.12.1) (2022-04-21)
### Bug Fixes
- upgrade react peerDependencies to support react^18.0.0 ([#323](https://github.com/contentful/rich-text/issues/323)) ([7a0bfdf](https://github.com/contentful/rich-text/commit/7a0bfdfb687cca608239e072cbc301ba1b1310d1))
# [15.12.0](https://github.com/contentful/rich-text/compare/v15.11.2...v15.12.0) (2022-03-25)
### Features
- enforce minItems in table-related node types ([#314](https://github.com/contentful/rich-text/issues/314)) ([1125331](https://github.com/contentful/rich-text/commit/112533100f66ae01cd9944069dc62fc95f1737a5))
## [15.11.2](https://github.com/contentful/rich-text/compare/v15.11.1...v15.11.2) (2022-02-07)
### Bug Fixes
- set "typings" for rich-text-from-markdown ([1b3a15f](https://github.com/contentful/rich-text/commit/1b3a15f1cb15eacb6d1b15f2b79c5747e2d25618))
## [15.11.1](https://github.com/contentful/rich-text/compare/v15.11.0...v15.11.1) (2022-01-04)
### Bug Fixes
- **rich-text-types:** remove RT validation helpers ([#302](https://github.com/contentful/rich-text/issues/302)) ([fcd3a27](https://github.com/contentful/rich-text/commit/fcd3a277952f53eb3ae6ebb559ae6a02f5553c87)), closes [#295](https://github.com/contentful/rich-text/issues/295) [#274](https://github.com/contentful/rich-text/issues/274)
# [15.11.0](https://github.com/contentful/rich-text/compare/v15.10.1...v15.11.0) (2021-12-27)
### Bug Fixes
- **react-renderer:** wrap table rows in tbody ([#300](https://github.com/contentful/rich-text/issues/300)) ([e23d1f4](https://github.com/contentful/rich-text/commit/e23d1f4f5c63ce7ded84144b271f566327a144d1))
### Features
- **rich-text-types:** expose HEADINGS array ([#301](https://github.com/contentful/rich-text/issues/301)) ([758539d](https://github.com/contentful/rich-text/commit/758539d46f3db13c21ca2f6d74a389a6fef21803))
## [15.10.1](https://github.com/contentful/rich-text/compare/v15.10.0...v15.10.1) (2021-12-21)
### Bug Fixes
- remove support to convert tables from md to rich text ([a9d513c](https://github.com/contentful/rich-text/commit/a9d513c285e8cdedd384b89e195734dd3a8d2136))
# [15.10.0](https://github.com/contentful/rich-text/compare/v15.9.1...v15.10.0) (2021-12-15)
### Features
- support custom error transformer ([#296](https://github.com/contentful/rich-text/issues/296)) ([9449b87](https://github.com/contentful/rich-text/commit/9449b87fc063a00f11cfe7b2bc0fdb4d91251c69))
## [15.9.1](https://github.com/contentful/rich-text/compare/v15.9.0...v15.9.1) (2021-12-10)
### Bug Fixes
- **rich-text-types:** resolve generated JSON schemas ([#294](https://github.com/contentful/rich-text/issues/294)) ([1e5b4c4](https://github.com/contentful/rich-text/commit/1e5b4c474e1e27e97df177748c0c8df365a2ab71))
# [15.9.0](https://github.com/contentful/rich-text/compare/v15.8.0...v15.9.0) (2021-12-09)
### Features
- **rich-text-types:** expose RT validation helper ([#292](https://github.com/contentful/rich-text/issues/292)) ([fc5a7cc](https://github.com/contentful/rich-text/commit/fc5a7cc27244f293a9a50acd785f7edcdaaa96ea))
# [15.8.0](https://github.com/contentful/rich-text/compare/v15.7.0...v15.8.0) (2021-11-11)
### Features
- add toContentfulDocument() and toSlatejsDocument() empty block node handling ([#287](https://github.com/contentful/rich-text/issues/287)) ([fa79626](https://github.com/contentful/rich-text/commit/fa79626e4020d9640a920ca5d0ccb654e89cfa90))
# [15.7.0](https://github.com/contentful/rich-text/compare/v15.6.2...v15.7.0) (2021-11-11)
### Features
- **rich-text-types:** Add TEXT_CONTAINERS ([#286](https://github.com/contentful/rich-text/issues/286)) ([3356ea8](https://github.com/contentful/rich-text/commit/3356ea815a46901a6637f177b04bcf1926adc88d))
## [15.6.2](https://github.com/contentful/rich-text/compare/v15.6.1...v15.6.2) (2021-11-05)
**Note:** Version bump only for package @contentful/rich-text
## [15.6.1](https://github.com/contentful/rich-text/compare/v15.6.0...v15.6.1) (2021-11-05)
**Note:** Version bump only for package @contentful/rich-text
# [15.6.0](https://github.com/contentful/rich-text/compare/v15.5.1...v15.6.0) (2021-11-04)
### Features
- add support to convert tables from md to rich text ([#284](https://github.com/contentful/rich-text/issues/284)) ([213a29c](https://github.com/contentful/rich-text/commit/213a29c78d48b3e63088999c4eed4891906d1719))
## [15.5.1](https://github.com/contentful/rich-text/compare/v15.5.0...v15.5.1) (2021-10-25)
### Bug Fixes
- npm 15.5.0 ([#280](https://github.com/contentful/rich-text/issues/280)) ([e7aeba4](https://github.com/contentful/rich-text/commit/e7aeba49a3074fc9eae6aee569db4e30d1acb8b8))
# [15.5.0](https://github.com/contentful/rich-text/compare/v15.4.0...v15.5.0) (2021-10-25)
### Features
- add v1 node types constraints ([#279](https://github.com/contentful/rich-text/issues/279)) ([5026023](https://github.com/contentful/rich-text/commit/5026023610ec1439f24fd32df9977c2cd4c13e86))
# [15.4.0](https://github.com/contentful/rich-text/compare/v15.3.6...v15.4.0) (2021-09-16)
### Features
- **html+react:** render Table header as <th> ([#269](https://github.com/contentful/rich-text/issues/269)) ([0f82905](https://github.com/contentful/rich-text/commit/0f829059be6d91e042dfc71698009177ae4ab78d))
## [15.3.6](https://github.com/contentful/rich-text/compare/v15.3.5...v15.3.6) (2021-09-15)
### Bug Fixes
- allow table-row type to have both cells ([#267](https://github.com/contentful/rich-text/issues/267)) ([ec40598](https://github.com/contentful/rich-text/commit/ec405982109cb1c16e7adf71a541a98270d7f45b))
## [15.3.5](https://github.com/contentful/rich-text/compare/v15.3.4...v15.3.5) (2021-09-13)
### Bug Fixes
- **rich-text-types:** forbid Tables inside ListItem ([#266](https://github.com/contentful/rich-text/issues/266)) ([fc338bf](https://github.com/contentful/rich-text/commit/fc338bf040b8718057717d2681f800d5e26ba59d))
## [15.3.4](https://github.com/contentful/rich-text/compare/v15.3.3...v15.3.4) (2021-09-09)
### Bug Fixes
- replace import to fix typings for html-renderer ([#265](https://github.com/contentful/rich-text/issues/265)) ([40c2670](https://github.com/contentful/rich-text/commit/40c267069b18454517b0f4283a7e155cffa410b6))
## [15.3.3](https://github.com/contentful/rich-text/compare/v15.3.2...v15.3.3) (2021-09-07)
**Note:** Version bump only for package @contentful/rich-text
## [15.3.2](https://github.com/contentful/rich-text/compare/v15.3.1...v15.3.2) (2021-09-07)
**Note:** Version bump only for package @contentful/rich-text
## [15.3.1](https://github.com/contentful/rich-text/compare/v15.3.0...v15.3.1) (2021-09-07)
**Note:** Version bump only for package @contentful/rich-text
# Change Log
# [15.3.0](https://github.com/contentful/rich-text/compare/v15.2.0...v15.3.0) (2021-09-06)
### Bug Fixes
- allow the first item in Table to be a TableHeaderRow ([9a6de55](https://github.com/contentful/rich-text/commit/9a6de55ed97ca413d3922958850b8215922c06b5))
- don't export the helper TableHeaderRow type ([179c3cb](https://github.com/contentful/rich-text/commit/179c3cb10c0f65725297445afe955f0cca135005))
- typo ([2282665](https://github.com/contentful/rich-text/commit/2282665924404771b3353dd9b380d8863f1d4c41))
### Features
- add TableHeaderCell type ([5e25ac9](https://github.com/contentful/rich-text/commit/5e25ac9f35be2ad6c7ad7857cbde808cbc3437f9))
# [15.2.0](https://github.com/contentful/rich-text/compare/v15.1.0...v15.2.0) (2021-08-16)
### Bug Fixes
- 🐛 html encode default inlined CF entry/asset links ([41396eb](https://github.com/contentful/rich-text/commit/41396eb800f6d5c65c634c4394a6c60cf3425255))
- 🐛 prevent html injection via `data.uri` link rendering ([ecae89a](https://github.com/contentful/rich-text/commit/ecae89ad0d25175f342833ca989928670c24b8fd))
- audit fix aiming mixing-deep vulnerability ([2b98cbd](https://github.com/contentful/rich-text/commit/2b98cbd8e85435305378dd91d70d55db5e9c0832))
- audit fix root folder ([ffe9e44](https://github.com/contentful/rich-text/commit/ffe9e44c98611b0705f697c693e9b6b9d6c757cf))
# [15.1.0](https://github.com/contentful/rich-text/compare/v15.0.0...v15.1.0) (2021-08-02)
### Features
- 🎸 add RT html renderer tables support ([ce81375](https://github.com/contentful/rich-text/commit/ce8137577b269c62727dc64b7d47b4951597dbd6))
- 🎸 add RT react renderer tables support ([fddfb8a](https://github.com/contentful/rich-text/commit/fddfb8a943b9807efe92b749d7ffdeb1308e42bd))
- add rowspan ([e0264fb](https://github.com/contentful/rich-text/commit/e0264fbe4d9467eedf78b7c5c3a9825a584124cf))
# [15.0.0](https://github.com/contentful/rich-text/compare/v14.2.0...v15.0.0) (2021-06-15)
### Bug Fixes
- **slatejs-adapter:** release as public package ([#227](https://github.com/contentful/rich-text/issues/227)) ([0ba8197](https://github.com/contentful/rich-text/commit/0ba81974a732bc6a32109b84e688e0903cc3632c))
### Features
- add table markup support ([c6ae127](https://github.com/contentful/rich-text/commit/c6ae127aa460f4cd26cd6b671cd43fd2714bc650))
# [14.2.0](https://github.com/contentful/rich-text/compare/v14.1.3...v14.2.0) (2021-05-04)
### Features
- {wip} update slate.js adapter ([c281aea](https://github.com/contentful/rich-text/commit/c281aea098e949c45ed08dd6b46babfc0a75bfb9))
- fix test types ([0c86f93](https://github.com/contentful/rich-text/commit/0c86f9362f551cf8a2fcbeacfd995052a93a936a))
- update contentful-to-slatejs adapter ([33a3b6d](https://github.com/contentful/rich-text/commit/33a3b6d69c118e53b7b8464e1c41d9da26edf8d9))
- update contentful-to-slatejs-adapter ([89a32f4](https://github.com/contentful/rich-text/commit/89a32f494e434fa63b70146da29a81e24fae3cea))
## [14.1.3](https://github.com/contentful/rich-text/compare/v14.1.2...v14.1.3) (2021-04-12)
## [14.1.2](https://github.com/contentful/rich-text/compare/v14.0.1...v14.1.2) (2020-11-02)
### Bug Fixes
- 🐛 configure rollup copy correctly ([3446a33](https://github.com/contentful/rich-text/commit/3446a33fc5711087095a58b088828dfe6066bc7f))
- 🐛 skip lib check for TS ([e8bf2ba](https://github.com/contentful/rich-text/commit/e8bf2ba61be9f36f104d0e0337829ac07b30eec6))
- Add leaf object ([#5](https://github.com/contentful/rich-text/issues/5)) ([fb0b80d](https://github.com/contentful/rich-text/commit/fb0b80d7be60eb40a8dcfb51d65db2e488ea0097))
- Add lodash.omit to externals ([#7](https://github.com/contentful/rich-text/issues/7)) ([1c65200](https://github.com/contentful/rich-text/commit/1c652002831161fa34b59b18177565db057e3bc5))
- Remove doc deployment and fix ([90bccaa](https://github.com/contentful/rich-text/commit/90bccaaa9125cfe50627b27fff7a1b88a9044d3e))
### Features
- Add a default value for Marks ([6828215](https://github.com/contentful/rich-text/commit/68282155ee41f64e7f762b6823fd6d9b982ea160))
- Add data transform ([#6](https://github.com/contentful/rich-text/issues/6)) ([9d90fa1](https://github.com/contentful/rich-text/commit/9d90fa1995939a58739dbfaa0033b92b259d0687))
- Cleans up the `mark` property from extra props ([20ec641](https://github.com/contentful/rich-text/commit/20ec641130a17169587dae21e6fb231c180496d1))
- **contentful-to-slate:** Implement new isVoid in Slate's Node ([3d2d38d](https://github.com/contentful/rich-text/commit/3d2d38d22e43c4500252cba7af21d29a89c6fbda))
- data defaults to an empty object ([0a9b8a0](https://github.com/contentful/rich-text/commit/0a9b8a01049a6c48f38b09ea7075c17620db18dc))
- first version ([11591d0](https://github.com/contentful/rich-text/commit/11591d0d32fa81028ab71946c7fd68f783b56022))
- integrate structured-text-types ([#8](https://github.com/contentful/rich-text/issues/8)) ([d6d5e37](https://github.com/contentful/rich-text/commit/d6d5e376a7562821264ad7e3cc70b7d3cdff6ba5))
- remove content from void nodes ([0ce9898](https://github.com/contentful/rich-text/commit/0ce989824ae3adb8452ae20db821500f63d95d68))
- Remove nodeClass from Contentful's Document ([23bb2d5](https://github.com/contentful/rich-text/commit/23bb2d533301bf46b4f7eb0407b61972d3b38fff))
- update dependencies ([e294233](https://github.com/contentful/rich-text/commit/e29423329e5aa3c518fd6ca6a0cdda0c7cda440c))
- Update structured-text-type version ([#9](https://github.com/contentful/rich-text/issues/9)) ([ced65da](https://github.com/contentful/rich-text/commit/ced65dab9db1391f5b969d742594e2b9670ebb22))
### Performance Improvements
- ⚡️ Remove lodash.omit dependency ([93b6b76](https://github.com/contentful/rich-text/commit/93b6b765488a6d3e003a832c953ae10c3f68672e))
### BREAKING CHANGES
- Remove nodeClass from Contentful's Document
- Changed the interface of Slate->Contentful adapter. Added new parameter Schema
- **contentful-to-slate:** toSlatejsDocument now accepts Schema
- Only supports structured-text-types >= 2.0.0
## [14.0.1](https://github.com/contentful/rich-text/compare/v14.0.0...v14.0.1) (2020-01-30)
### Features
- 🎸 emptyDoc representing an empty RT document ([80315ef](https://github.com/contentful/rich-text/commit/80315ef5130b79336336ba31de8a55e42bafe319))
# [14.0.0](https://github.com/contentful/rich-text/compare/v13.4.0...v14.0.0) (2020-01-28)
### Bug Fixes
- 🐛 detect links as children of nodes also having links ([565f423](https://github.com/contentful/rich-text/commit/565f423b2881c7bcfac40e9ee9ecb6a545fce047))
# [13.4.0](https://github.com/contentful/rich-text/compare/v13.3.0...v13.4.0) (2019-08-01)
### Features
- 🎸 Adds BLOCKS.DOCUMENT renderer support to react-renderer ([57c922c](https://github.com/contentful/rich-text/commit/57c922cb638c47729f2189815a647ba68859394e)), closes [#104](https://github.com/contentful/rich-text/issues/104)
# [13.3.0](https://github.com/contentful/rich-text/compare/v13.2.0...v13.3.0) (2019-03-21)
# [13.2.0](https://github.com/contentful/rich-text/compare/v13.1.0...v13.2.0) (2019-03-18)
### Features
- 🎸 renderText option to alter all text ([f684a6e](https://github.com/contentful/rich-text/commit/f684a6e91d81ab0c66c286adaa923bd2edf0f4f1))
# [13.1.0](https://github.com/contentful/rich-text/compare/v13.0.1...v13.1.0) (2019-03-04)
### Bug Fixes
- 🐛 Fix incorrect typings file path ([cca74d5](https://github.com/contentful/rich-text/commit/cca74d5594fb0594fd1117945e087afa2000877b))
### Features
- 🎸 Support filtering by node name in rich-text-links ([5ec0dda](https://github.com/contentful/rich-text/commit/5ec0dda07cdbe3d28027d28520c553b074ca699f))
## [13.0.1](https://github.com/contentful/rich-text/compare/v13.0.0...v13.0.1) (2019-02-11)
### Bug Fixes
- 🐛 Fix wrong import in tests ([bead583](https://github.com/contentful/rich-text/commit/bead583e6e9bb71638694e466980b90e599fa47b))
- 🐛 make "time to read" great again ([6edd37d](https://github.com/contentful/rich-text/commit/6edd37d47fadcc0145188fa1fdfae811cb4145dd))
### Features
- 🎸 Initial rich-text-react-renderer implementation ([06dad9b](https://github.com/contentful/rich-text/commit/06dad9b0359325d8fa433438dac997fc9656d13f))
# [13.0.0](https://github.com/contentful/rich-text/compare/v12.2.1...v13.0.0) (2019-01-22)
### Bug Fixes
- 🐛 use named export instead of default ([57bf365](https://github.com/contentful/rich-text/commit/57bf36510f1021f5208a3e33242cceea97940d68))
### BREAKING CHANGES
- removes default export from 'rich-text-plain-text-renderer'
## [12.2.1](https://github.com/contentful/rich-text/compare/v12.2.0...v12.2.1) (2019-01-22)
### Bug Fixes
- gracefully handle empty rich text documents ([14870de](https://github.com/contentful/rich-text/commit/14870ded471f69cee84a60739bee06873ed53af9))
### Features
- 🎸 add time to read for reach text ([5f2115a](https://github.com/contentful/rich-text/commit/5f2115afd1ef41e0e5eb419368510d682524706e))
# [12.2.0](https://github.com/contentful/rich-text/compare/v12.1.2...v12.2.0) (2018-12-20)
### Bug Fixes
- fix import path ([3f3edff](https://github.com/contentful/rich-text/commit/3f3edff8bc4f4463a701d0ae1d397fcf9acec325))
- ignore unsupported marks ([1757331](https://github.com/contentful/rich-text/commit/1757331a74f360353556a242a9fe20da131b9a59))
### Features
- 🎸 parse links inside marks ([11722cf](https://github.com/contentful/rich-text/commit/11722cfad85d5e15b10d2b18d3c831ec613922c3))
## [12.1.2](https://github.com/contentful/rich-text/compare/v12.1.1...v12.1.2) (2018-12-14)
### Bug Fixes
- fix npm ignore ([5c9e58e](https://github.com/contentful/rich-text/commit/5c9e58ed7fabecf430c91a6776665d8ad73f4bf3))
### Features
- add html escaping ([4b55331](https://github.com/contentful/rich-text/commit/4b55331e86bc62787420f8081228293f1a22e1b7))
## [12.1.1](https://github.com/contentful/rich-text/compare/v12.1.0...v12.1.1) (2018-12-12)
### Bug Fixes
- handle hyperlinks ([54508d4](https://github.com/contentful/rich-text/commit/54508d495adf5055e4089f54dd62f00f8be6be46))
# [12.1.0](https://github.com/contentful/rich-text/compare/v12.0.4...v12.1.0) (2018-12-12)
### Bug Fixes
- **async-handling:** move to promise-based api ([a07d3fc](https://github.com/contentful/rich-text/commit/a07d3fcbd99a2d80f86bc6dcf5cba01665221ebc))
## [12.0.4](https://github.com/contentful/rich-text/compare/v12.0.3...v12.0.4) (2018-12-05)
### Bug Fixes
- Add index.js ([383cc98](https://github.com/contentful/rich-text/commit/383cc98e5dbcf8f144c8504759c6090daff611db))
- **package:** add babel/runtime to deps; remove 'main' from package.json ([f7adbff](https://github.com/contentful/rich-text/commit/f7adbfffe704335601751e0f43f073ba867bc534))
- **package:** use caret operator for gatsby peer dep ([21478ef](https://github.com/contentful/rich-text/commit/21478ef77f96546dab561f603940d4de5553340e))
## [12.0.3](https://github.com/contentful/rich-text/compare/v12.0.2...v12.0.3) (2018-12-05)
### Bug Fixes
- **build:** rm gatsby from dev-deps on gatsby plugin ([2b3f87b](https://github.com/contentful/rich-text/commit/2b3f87b0bae48b32456a10f3a9c48c9c921df401))
- **deps:** dep to old version within monorepo ([b0da60a](https://github.com/contentful/rich-text/commit/b0da60af975cb45d94063bd78bd2b2882ad0da80))
- **readme:** mark types in readme examples ([d997b56](https://github.com/contentful/rich-text/commit/d997b56f2b8c32b2e5b478ab5444757203e2c703))
- Remove debugger ([c7c9c4f](https://github.com/contentful/rich-text/commit/c7c9c4f1a41d98825cdc782d3b529da03d237d3a))
### Features
- **transformer:** Add gatsby-transformer-contentful-richtext ([8ed2adb](https://github.com/contentful/rich-text/commit/8ed2adbe9b53cbe9992e4483a67b05e7950a743c))
### Performance Improvements
- ⚡️ prefer iterator unrolling to Array.from ([a887a92](https://github.com/contentful/rich-text/commit/a887a9213dee9dd6986cf313e67b94fd020d138b))
## [12.0.2](https://github.com/contentful/rich-text/compare/v12.0.1...v12.0.2) (2018-12-04)
### Bug Fixes
- 🐛 update path to typings ([ce5544f](https://github.com/contentful/rich-text/commit/ce5544f58712dc6a18aadda523d0c0357a66c8a5))
## [12.0.1](https://github.com/contentful/rich-text/compare/v12.0.0...v12.0.1) (2018-12-04)
### Bug Fixes
- 🐛 add Object.values and Array.prototype.includes polyfills ([9e2ffb4](https://github.com/contentful/rich-text/commit/9e2ffb46e3564a523c74504270b29ccc8b8249ad))
- **from-markdown:** Fix list typos ([c392016](https://github.com/contentful/rich-text/commit/c392016e2f11628021cd27bff3447f548398c3b4))
- **parsing:** list item, (un)ordered list, links, quotes ([8a0c580](https://github.com/contentful/rich-text/commit/8a0c580306c154f1c1d6c2ba964c46d18881be12))
- **text:** Parse text nodes with marks correctly ([d489f90](https://github.com/contentful/rich-text/commit/d489f904a33726f42006b09871d15bcfbdd7e274))
# [12.0.0](https://github.com/contentful/rich-text/compare/v11.0.0...v12.0.0) (2018-11-29)
### Features
- 🎸 `getRichTextEntityLinks` perf and signature changes ([fcd6d7f](https://github.com/contentful/rich-text/commit/fcd6d7f42e63df87ddb58d651b86a023d45f990e))
### Performance Improvements
- ⚡️ Add benchmark support ([ae278b7](https://github.com/contentful/rich-text/commit/ae278b7be515a52576af0a1abb6a4cefb05f71a7))
### BREAKING CHANGES
- Produces an entirely new return value and obviates the `linkType`
parameter (all entities are grouped and returned by default).
# [11.0.0](https://github.com/contentful/rich-text/compare/v10.3.0...v11.0.0) (2018-11-27)
### Bug Fixes
- 🐛 Removes cz-lerna-changelog from devDependencies ([31daac0](https://github.com/contentful/rich-text/commit/31daac0d10a66186e01a085bd466fdc18a20ab5f))
- 🐛 Removes obsolete field `title` from Hyperlinks ([8cb9027](https://github.com/contentful/rich-text/commit/8cb90279f5348a7fb59f211c2ba209a28fd432be))
# [10.3.0](https://github.com/contentful/rich-text/compare/v10.2.0...v10.3.0) (2018-11-26)
### Features
- 🎸 return all entity links when no linkType is provided ([02970ea](https://github.com/contentful/rich-text/commit/02970ea61b5b13d99c7b629902defe704c146b17))
# [10.2.0](https://github.com/contentful/rich-text/compare/v10.1.0...v10.2.0) (2018-11-19)
### Features
- 🎸 Add rich-text-references ([363b4e5](https://github.com/contentful/rich-text/commit/363b4e509e94af0932fd7cece8e56beafe8d67d2))
- 🎸 Rename, refactor, docu. & cache r-t-links ([9cf6d14](https://github.com/contentful/rich-text/commit/9cf6d1460833300053cb8dde5a6e29b0ddf89964))
# [10.1.0](https://github.com/contentful/rich-text/compare/v10.0.5...v10.1.0) (2018-11-16)
### Bug Fixes
- 🐛 removes obsolete fields from mark nodes ([b638a56](https://github.com/contentful/rich-text/commit/b638a56652520969d3ac898ac158be81a9788f67))
### Features
- 🎸 adds json schema generation to rich text types ([8916140](https://github.com/contentful/rich-text/commit/89161404eb911f126be23ba2a146ebf748f7489e))
- 🎸 introduces top-level-block type ([a6bf35e](https://github.com/contentful/rich-text/commit/a6bf35e7c9ca35915a512de774b3a3fdc4c76e5d))
## [10.0.5](https://github.com/contentful/rich-text/compare/v10.0.4...v10.0.5) (2018-11-12)
### Bug Fixes
- 🐛 handle case of missing rootNode / rootNode.content ([e2434c7](https://github.com/contentful/rich-text/commit/e2434c7f5e1401f1188dd778c2aa9a108cea5596))
## [10.0.4](https://github.com/contentful/rich-text/compare/v10.0.3...v10.0.4) (2018-11-09)
## [10.0.3](https://github.com/contentful/rich-text/compare/v10.0.2...v10.0.3) (2018-11-09)
## [10.0.2](https://github.com/contentful/rich-text/compare/v10.0.1...v10.0.2) (2018-11-09)
## [10.0.1](https://github.com/contentful/rich-text/compare/v10.0.0...v10.0.1) (2018-11-08)
### Features
- **packages:** Add rich text from markdown package ([bc8ec41](https://github.com/contentful/rich-text/commit/bc8ec41f5615eabcc29031ee99da3f9c70b414b3))
# [10.0.0](https://github.com/contentful/rich-text/compare/v9.0.2...v10.0.0) (2018-11-02)
### Features
- 🎸 removes nodeClass from Node interface ([09b8162](https://github.com/contentful/rich-text/commit/09b8162bcba65bc13afa14b2b5ff046c9fed7b3b))
### BREAKING CHANGES
- Removes accidentally added nodeClass
## [9.0.2](https://github.com/contentful/rich-text/compare/v9.0.1...v9.0.2) (2018-10-31)
## [9.0.1](https://github.com/contentful/rich-text/compare/v9.0.0...v9.0.1) (2018-10-31)
# [9.0.0](https://github.com/contentful/rich-text/compare/v8.0.3...v9.0.0) (2018-10-30)
### Bug Fixes
- 🐛 Fix block divisor provision ([3aafb7a](https://github.com/contentful/rich-text/commit/3aafb7a756d8b6f96ef733eb299091404b3391aa))
- 🐛 remove exclusive mocha test ([5ff5d0e](https://github.com/contentful/rich-text/commit/5ff5d0e35024b7dccda065f54ae34138d9416525))
### Features
- 🎸 Explicitly declare nodeClass and nodeType in core types ([0749c61](https://github.com/contentful/rich-text/commit/0749c6199bb2681509608539c76bd8149cade564))
### BREAKING CHANGES
- Fundamentally alters the plain text renderer behavior. (For the better!)
- Potentially breaks TypeScript libraries pulling this in as a dependency
if they are not explicitly stating nodeClass and nodeType.
## [8.0.3](https://github.com/contentful/rich-text/compare/v8.0.2...v8.0.3) (2018-10-30)
## [8.0.2](https://github.com/contentful/rich-text/compare/v8.0.1...v8.0.2) (2018-10-29)
## [8.0.1](https://github.com/contentful/rich-text/compare/v8.0.0...v8.0.1) (2018-10-26)
### Bug Fixes
- 🐛 Revert mock hypenation commits ([bde9432](https://github.com/contentful/rich-text/commit/bde94323fcc02bf5ab3feeef46a9d8fc8b08d59b))
- sync HTML renderer ([769bd95](https://github.com/contentful/rich-text/commit/769bd95add1aecad0e11fab377f99c5cdad99072))
### Features
- 🎸 take all packages out of "demo mode" ([815f18b](https://github.com/contentful/rich-text/commit/815f18be6a914e7e4782790ee46053689712494b))
### BREAKING CHANGES
- renames all packages
## [7.0.1](https://github.com/contentful/rich-text/compare/v7.0.0...v7.0.1) (2018-10-26)
### Bug Fixes
- 🐛 hypenate more hyperlink tokens ([f88b377](https://github.com/contentful/rich-text/commit/f88b3775c1849fd0ca26b103999d819fd1b9b801))
# [7.0.0](https://github.com/contentful/rich-text/compare/v6.0.0...v7.0.0) (2018-10-26)
### Bug Fixes
- 🐛 blockquote -> block-quote ([5b66181](https://github.com/contentful/rich-text/commit/5b66181943d835baffd7574edef5dd34ac301923))
- 🐛 hyphenate hyper-link ([662f60d](https://github.com/contentful/rich-text/commit/662f60dd966202a03dab9c49719bf34166fbdaed))
- 🐛 Remove .releaserc.js ([f1f72a7](https://github.com/contentful/rich-text/commit/f1f72a7435bcc60cdd1a63979cade47cd91c05fb))
### chore
- 🤖 :%s/ci/travis ([4731881](https://github.com/contentful/rich-text/commit/47318816edb1d9cac3f778931bb921c522e7be3a))
- 🤖 swap for semantic-release-monorepo ([cb8ca3e](https://github.com/contentful/rich-text/commit/cb8ca3ef5a4f3df9c041967352a611f4216c9d81))
### BREAKING CHANGES
- major version bump
- None, but let's pretend like there are some anyway to trigger a major
version bump
# 6.0.0 (2018-10-24)
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to `rich-text`
<p align="center">
<a href="http://makeapullrequest.com">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?maxAge=31557600" alt="PRs Welcome">
</a>
<a href="http://makeapullrequest.com">
<img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?maxAge=31557600" alt="Semantic Release">
</a>
<a href="http://standardjs.com/">
<img src="https://img.shields.io/badge/code%20style-standard-brightgreen.svg?maxAge=31557600" alt="JS Standard Style">
</a>
</p>
We appreciate any community contributions to this project, whether in the form
of issues or pull requests.
This document outlines what we'd like you to follow in terms of commit messages
and code style.
It also explains what to do if you want to set up the project locally and run
tests.
**Working on your first Pull Request?**
You can learn how from this _free_ series: [How to Contribute to an Open Source
Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
## Useful npm scripts
- `yarn build` builds vendored files in the `dist` directory of each package
- `yarn commit` runs git commits with [commitizen](http://commitizen.github.io/cz-cli/)
- `yarn clean` removes any built files and `node_modules`
- `yarn lint` runs our TypeScript linter on all `.ts` files in each package
- `yarn test` runs unit tests for all packages
- `yarn test:watch` runs unit tests in "watch" mode (will refresh relevant
code paths on save)
## Setup
This project is a [Lerna](https://lernajs.io/) monorepo with several packages,
each published separately to npm.
### Local Development
Run `npm install` to install all necessary dependencies.
As a post-install step, all Lerna dependencies are [hoisted](https://github.com/lerna/lerna/blob/master/doc/hoist.md),
and hence internally reliant packages (e.g., `rich-text-html-renderer`, which
depends upon `rich-text-types`) will resolve their modules via symlink. In other
words, `npm install` will _both_ install external dependencies for each project,
_and_ ensure packages that pull in other packages in this repository as
dependencies are linked to the local version (rather than whatever the state
of those packages is on npm).
Each package is written in [TypeScript](https://www.typescriptlang.org/) and
compiled to ES5 using [rollup](https://rollupjs.org/guide/en) to the `dist`
directory.
This should generally only happen at publishing time, but you may want to run
`yarn build` prematurely during local development.
For example, let's say you're working on a pull request that
1. adds support for a type in `rich-text-types`, and
2. adds behavior to handle that type in `rich-text-html-renderer`.
If changes in the latter are dependent upon changes in the former, you'll need
to run `yarn build` to update the referenced vendored files in
`rich-text-html-renderer`.
All necessary dependencies are installed under `node_modules` and any necessary
tools can be accessed via npm scripts. There is no need to install anything
globally.
### Creating commits
We follow [Angular JS Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153#allowed-type)
to generate a changelog.
### Code style
This project uses [JavaScript Standard Style](https://standardjs.com/) and
[Prettier](https://prettier.io/) conventions. Install a relevant editor plugin
if you'd like. When in doubt, follow a style similar to the existing code :)
We use a common [rollup](https://rollupjs.org/guide/en) config to compile
packages from TypeScript to ES5. We also use common [TypeScript](https://www.typescriptlang.org/)
and [eslint](https://eslint.org/docs/v8.x/) configs. You'll notice
the `rollup.config.js` and `tsconfig.json` in each package largely reference
those files on a root level - this keeps code conventions consistent across the
repository as a whole.
### Running tests
We use [Jest](https://jestjs.io/) for unit tests. See **Useful npm scripts**
above for some relevant npm commands.
## Publishing
We use [Lerna](https://github.com/lerna/lerna) to:
- keep dependencies in sync
- `lerna bootstrap --hoist` (which is run as a post-install step)
- publish
- `NPM_CONFIG_OTP={2fa_otp_goes_here} yarn publish`
- As a community developer, you most likely won't have to worry about this
step :)
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Contentful
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# rich-text
Monorepo with Typescript libraries for handling and rendering Contentful Rich
Text documents.
## Packages
### Official
- [`rich-text-from-markdown`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-from-markdown)
- Converts markdown documents to rich text
- [`rich-text-html-renderer`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-html-renderer)
- Converts rich text documents to HTML
- [`rich-text-links`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-links)
- Entity (entry and asset) link extraction utilities
- [`rich-text-plain-text-renderer`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-plain-text-renderer)
- Converts rich text documents to plain text
- [`rich-text-types`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-types)
- Type definitions and constants for the rich text field type
- [`gatsby-transformer-contentful-richtext`](https://github.com/contentful/rich-text/tree/4ef875c44b4c8617f4035a46569b240d8cc67bbe/deprecated/gatsby-transformer-contentful-richtext) [DEPRECATED]
- Parses a Contentful Rich Text document to HTML in Gatsby
- [`rich-text-react-renderer`](https://github.com/contentful/rich-text/tree/master/packages/rich-text-react-renderer)
- Parses a Contentful Rich Text document to React components
### Community made
- [`rich-text-to-jsx`](https://github.com/connor-baer/rich-text-to-jsx)
- Opinionated JSX renderer for the Contentful rich text field type
- [`rich-text-flutter`](https://github.com/Kumanu/contentful-rich-text-flutter)
- Flutter renderer for the Contentful rich text field type (work in progress)
- [`ngx-contentful-rich-text`](https://github.com/kgajera/ngx-contentful-rich-text)
- Angular renderer for the Contentful rich text field type
## About Rich Text
- [Rich Text Concept](https://www.contentful.com/developers/docs/concepts/rich-text/)
- [Getting Started](https://www.contentful.com/developers/docs/tutorials/general/getting-started-with-rich-text-field-type/)
- [Migrate content to Rich Text](https://www.contentful.com/developers/docs/tutorials/general/migrate-to-rich-text/)
## Get involved
[](http://makeapullrequest.com)
We appreciate any help on our repositories. For more details about how to
contribute, see our [CONTRIBUTING.md](https://github.com/contentful/rich-text/blob/master/CONTRIBUTING.md)
document.
## Reach out to us
### You have questions about how to use this library?
- Reach out to our community forum: [](https://support.contentful.com/)
- Jump into our community slack channel: [](https://www.contentful.com/slack/)
### You found a bug or want to propose a feature?
- File an issue here on GitHub: [](https://github.com/contentful/rich-text/issues/new). Make sure to remove any credential from your code before sharing it.
### You need to share confidential information or have other questions?
- File a support ticket at our Contentful Customer Support: [](https://www.contentful.com/support/)
## License
This repository is published under the [MIT](LICENSE) license.
## Code of Conduct
We want to provide a safe, inclusive, welcoming, and harassment-free space and experience for all participants, regardless of gender identity and expression, sexual orientation, disability, physical appearance, socioeconomic status, body size, ethnicity, nationality, level of experience, age, religion (or lack thereof), or other identity markers.
[Read our full Code of Conduct](https://github.com/contentful-developer-relations/community-code-of-conduct).
================================================
FILE: baseJestConfig.js
================================================
function getConfig(packageName) {
return {
collectCoverage: true,
testPathIgnorePatterns: ['/dist/'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1', // strip .js so TS imports resolve
},
transform: {
'^.+\\.(j|t)sx?$': '@swc/jest',
},
testMatch: ['**/*.test.[jt]s?(x)'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '../../reports',
outputName: `${packageName}-results.xml`,
addFileAttribute: true,
},
],
],
};
}
module.exports = getConfig;
================================================
FILE: catalog-info.yaml
================================================
apiVersion: backstage.io/v1alpha1
kind: System
metadata:
name: rich-text
description: |
Monorepo with Typescript libraries for handling and rendering Contentful Rich Text documents.
annotations:
circleci.com/project-slug: github/contentful/rich-text
github.com/project-slug: contentful/rich-text
backstage.io/source-location: url:https://github.com/contentful/rich-text/
contentful.com/ci-alert-slack: prd-authoring-pub-alerts
spec:
type: library
lifecycle: production
owner: group:team-content-authoring-and-publishing
================================================
FILE: commitlint.config.js
================================================
module.exports = { extends: ['@commitlint/config-conventional'] };
================================================
FILE: lerna.json
================================================
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"npmClient": "pnpm",
"version": "independent",
"packages": ["packages/*"],
"command": {
"version": {
"allowBranch": "master",
"conventionalCommits": true,
"message": "chore(release): updated release notes and package versions [ci skip]",
"ignoreChanges": [
"*.md",
"*.mdx",
"**/*.spec.*",
"**/*.test.*",
"**/*.stories.*",
"**/__fixtures__/**",
"**/__tests__/**"
]
}
}
}
================================================
FILE: nx.json
================================================
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": [
"build",
"lint",
"prebuild",
"test",
"test:prod",
"generate-json-schema"
]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"]
},
"lint": {
"dependsOn": ["^lint"],
"outputs": ["{projectRoot}/]"]
},
"prebuild": {
"dependsOn": ["^prebuild"]
},
"test": {
"dependsOn": ["^test"]
},
"generate-json-schema": {
"dependsOn": ["^generate-json-schema"],
"outputs": ["{projectRoot}/src/schemas/generated"]
}
},
"affected": {
"defaultBase": "origin/master"
},
"defaultBase": "master",
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": ["default"]
}
}
================================================
FILE: package.json
================================================
{
"name": "@contentful/rich-text",
"private": true,
"description": "A monorepo for all NPM packages related to Rich Text",
"author": "Contentful GmbH",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/contentful/rich-text.git"
},
"engines": {
"node": ">=24"
},
"scripts": {
"build": "lerna run build",
"clean": "lerna exec 'rm -rf node_modules/ dist/' && rm -rf node_modules/",
"lint": "eslint ./ --ext .ts,.tsx",
"lerna": "lerna",
"prettier": "prettier './**/*.{js,jsx,ts,tsx,md,mdx}' --write",
"prettier:check": "prettier --check '**/*.{jsx,js,ts,tsx,md,mdx}'",
"prebuild": "lerna run prebuild",
"start": "lerna run start",
"test": "lerna run test",
"prepare": "husky"
},
"workspaces": [
"packages/*"
],
"lint-staged": {
"**/*.{jsx,js,ts,tsx,md,mdx}": [
"prettier --write"
]
},
"prettier": {
"singleQuote": true,
"trailingComma": "all"
},
"devDependencies": {
"@commitlint/cli": "20.3.1",
"@commitlint/config-conventional": "20.3.1",
"@rollup/plugin-commonjs": "^29.0.0",
"@rollup/plugin-node-resolve": "16.0.3",
"@rollup/plugin-swc": "0.4.0",
"@swc/core": "1.15.10",
"@swc/cli": "0.7.10",
"@swc/jest": "0.2.39",
"@types/jest": "30.0.0",
"@types/rollup-plugin-json": "^3.0.7",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint": "8.57.1",
"eslint-plugin-jest": "29.12.1",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-import-helpers": "2.0.0",
"eslint-plugin-you-dont-need-lodash-underscore": "6.14.0",
"husky": "^9.0.11",
"jest": "30.2.0",
"jest-junit": "16.0.0",
"lerna": "8.2.3",
"lint-staged": "16.2.7",
"prettier": "^3.2.5",
"rimraf": "6.1.2",
"rollup": "^4.18.0",
"rollup-plugin-json": "^4.0.0",
"typescript": "5.9.3"
},
"packageManager": "pnpm@10.33.0",
"pnpm": {
"overrides": {
"react-is": "^19.2.3"
}
}
}
================================================
FILE: packages/contentful-slatejs-adapter/.editorconfig
================================================
#root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100
indent_size = 2
[*.md]
trim_trailing_whitespace = false
================================================
FILE: packages/contentful-slatejs-adapter/.gitignore
================================================
node_modules
coverage
.nyc_output
.DS_Store
*.log
.vscode
.idea
dist
compiled
.awcache
.rpt2_cache
docs
.vs/slnx.sqlite
================================================
FILE: packages/contentful-slatejs-adapter/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [16.2.1](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.2.0...@contentful/contentful-slatejs-adapter@16.2.1) (2026-04-09)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [16.2.0](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.6...@contentful/contentful-slatejs-adapter@16.2.0) (2026-04-08)
### Features
- add esm support [ZEND-7778] ([#1069](https://github.com/contentful/rich-text/issues/1069)) ([8c320bd](https://github.com/contentful/rich-text/commit/8c320bde7fa313572bdad84b91a6fd12224afc3a)), closes [#1068](https://github.com/contentful/rich-text/issues/1068)
## [16.1.6](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.5...@contentful/contentful-slatejs-adapter@16.1.6) (2025-11-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.1.5](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.4...@contentful/contentful-slatejs-adapter@16.1.5) (2025-11-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.1.4](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.3...@contentful/contentful-slatejs-adapter@16.1.4) (2025-09-23)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.1.3](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.2...@contentful/contentful-slatejs-adapter@16.1.3) (2025-09-23)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.1.2](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.1...@contentful/contentful-slatejs-adapter@16.1.2) (2025-09-10)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.1.1](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.1.0...@contentful/contentful-slatejs-adapter@16.1.1) (2025-09-09)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [16.1.0](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.0.4...@contentful/contentful-slatejs-adapter@16.1.0) (2025-09-04)
### Features
- migrate to swc and use lingui for i18n [TOL-3288] ([#914](https://github.com/contentful/rich-text/issues/914)) ([b6782a9](https://github.com/contentful/rich-text/commit/b6782a9658b24944ccce2676f06efb1a527d9936))
## [16.0.4](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.0.3...@contentful/contentful-slatejs-adapter@16.0.4) (2025-08-25)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.0.3](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.0.2...@contentful/contentful-slatejs-adapter@16.0.3) (2025-07-28)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.0.2](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.0.1...@contentful/contentful-slatejs-adapter@16.0.2) (2025-07-15)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [16.0.1](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@16.0.0...@contentful/contentful-slatejs-adapter@16.0.1) (2025-06-16)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [16.0.0](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.11...@contentful/contentful-slatejs-adapter@16.0.0) (2024-10-29)
### Features
- bring rich text validator [TOL-2426] ([#694](https://github.com/contentful/rich-text/issues/694)) ([30893a6](https://github.com/contentful/rich-text/commit/30893a68b171167502135b48258ba4b93c8375c7))
### BREAKING CHANGES
- removed getSchemaWithNodeType in favor of validateRichTextDocument
## [15.18.11](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.10...@contentful/contentful-slatejs-adapter@15.18.11) (2024-09-09)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.10](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.9...@contentful/contentful-slatejs-adapter@15.18.10) (2024-08-26)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.9](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.8...@contentful/contentful-slatejs-adapter@15.18.9) (2024-07-29)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.8](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.7...@contentful/contentful-slatejs-adapter@15.18.8) (2024-07-24)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.7](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.6...@contentful/contentful-slatejs-adapter@15.18.7) (2024-07-17)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.6](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.5...@contentful/contentful-slatejs-adapter@15.18.6) (2024-07-17)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.5](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.4...@contentful/contentful-slatejs-adapter@15.18.5) (2024-07-16)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.4](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.3...@contentful/contentful-slatejs-adapter@15.18.4) (2024-07-16)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.3](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.2...@contentful/contentful-slatejs-adapter@15.18.3) (2024-07-16)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.2](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.1...@contentful/contentful-slatejs-adapter@15.18.2) (2024-06-25)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.18.1](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.18.0...@contentful/contentful-slatejs-adapter@15.18.1) (2024-06-25)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.18.0](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.17.5...@contentful/contentful-slatejs-adapter@15.18.0) (2024-06-25)
### Features
- switch from tslint to eslint [TOL-2218][tol-2203] ([#594](https://github.com/contentful/rich-text/issues/594)) ([c077b5a](https://github.com/contentful/rich-text/commit/c077b5af58f94c8dc6af4715d4b82c2771d643c5))
## [15.17.5](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.17.4...@contentful/contentful-slatejs-adapter@15.17.5) (2024-06-25)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.17.4](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.17.3...@contentful/contentful-slatejs-adapter@15.17.4) (2024-06-25)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.17.3](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.17.2...@contentful/contentful-slatejs-adapter@15.17.3) (2024-05-28)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.17.2](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.17.1...@contentful/contentful-slatejs-adapter@15.17.2) (2024-05-27)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.17.1](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.17.0...@contentful/contentful-slatejs-adapter@15.17.1) (2024-05-24)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.17.0](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.14...@contentful/contentful-slatejs-adapter@15.17.0) (2024-05-22)
### Features
- upgrading rollup to latest version [TOL-2097] ([#559](https://github.com/contentful/rich-text/issues/559)) ([f14d197](https://github.com/contentful/rich-text/commit/f14d1974590d58f92bbf4cb56644095dba929ad9))
## [15.16.14](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.13...@contentful/contentful-slatejs-adapter@15.16.14) (2024-05-22)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.13](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.12...@contentful/contentful-slatejs-adapter@15.16.13) (2024-03-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.12](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.11...@contentful/contentful-slatejs-adapter@15.16.12) (2024-01-30)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.11](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.10...@contentful/contentful-slatejs-adapter@15.16.11) (2024-01-23)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.10](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.9...@contentful/contentful-slatejs-adapter@15.16.10) (2024-01-23)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.9](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.8...@contentful/contentful-slatejs-adapter@15.16.9) (2024-01-23)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.8](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.7...@contentful/contentful-slatejs-adapter@15.16.8) (2023-09-12)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.7](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.6...@contentful/contentful-slatejs-adapter@15.16.7) (2023-08-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.6](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.5...@contentful/contentful-slatejs-adapter@15.16.6) (2023-05-26)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.5](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.4...@contentful/contentful-slatejs-adapter@15.16.5) (2023-05-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.4](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.3...@contentful/contentful-slatejs-adapter@15.16.4) (2023-04-03)
### Bug Fixes
- entrypoint for types of package ([#454](https://github.com/contentful/rich-text/issues/454)) ([3809d57](https://github.com/contentful/rich-text/commit/3809d57891be88950798c1c2638ee5cebc376bd4))
## [15.16.3](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.2...@contentful/contentful-slatejs-adapter@15.16.3) (2023-03-14)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.2](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.1...@contentful/contentful-slatejs-adapter@15.16.2) (2022-12-01)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.16.1](https://github.com/contentful/rich-text/compare/@contentful/contentful-slatejs-adapter@15.16.0...@contentful/contentful-slatejs-adapter@15.16.1) (2022-12-01)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# 15.16.0 (2022-12-01)
## 15.15.1 (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# 15.15.0 (2022-11-29)
## 15.14.1 (2022-11-23)
# 15.14.0 (2022-11-14)
### Features
- add super/sub script types ([#391](https://github.com/contentful/rich-text/issues/391)) ([2562f66](https://github.com/contentful/rich-text/commit/2562f66278f0eff4eeeb367025d4b465773893d1))
## 15.13.2 (2022-09-07)
### Bug Fixes
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
- update Lerna, rollup in slatejs-adapter ([#366](https://github.com/contentful/rich-text/issues/366)) ([32448e3](https://github.com/contentful/rich-text/commit/32448e369ae2b76601dd81839e13c15432430d68))
## 15.13.1 (2022-05-10)
## 15.12.1 (2022-04-21)
# 15.12.0 (2022-03-25)
## 15.11.1 (2022-01-04)
# 15.11.0 (2021-12-27)
## 15.10.1 (2021-12-21)
# 15.10.0 (2021-12-15)
### Features
- support custom error transformer ([#296](https://github.com/contentful/rich-text/issues/296)) ([9449b87](https://github.com/contentful/rich-text/commit/9449b87fc063a00f11cfe7b2bc0fdb4d91251c69))
## 15.9.1 (2021-12-10)
### Bug Fixes
- **rich-text-types:** resolve generated JSON schemas ([#294](https://github.com/contentful/rich-text/issues/294)) ([1e5b4c4](https://github.com/contentful/rich-text/commit/1e5b4c474e1e27e97df177748c0c8df365a2ab71))
# 15.9.0 (2021-12-09)
# 15.8.0 (2021-11-11)
### Features
- add toContentfulDocument() and toSlatejsDocument() empty block node handling ([#287](https://github.com/contentful/rich-text/issues/287)) ([fa79626](https://github.com/contentful/rich-text/commit/fa79626e4020d9640a920ca5d0ccb654e89cfa90))
# 15.7.0 (2021-11-11)
## 15.6.1 (2021-11-05)
# 15.6.0 (2021-11-04)
# 15.5.0 (2021-10-25)
### Features
- add v1 node types constraints ([#279](https://github.com/contentful/rich-text/issues/279)) ([5026023](https://github.com/contentful/rich-text/commit/5026023610ec1439f24fd32df9977c2cd4c13e86))
## 15.3.5 (2021-09-13)
### Bug Fixes
- **rich-text-types:** forbid Tables inside ListItem ([#266](https://github.com/contentful/rich-text/issues/266)) ([fc338bf](https://github.com/contentful/rich-text/commit/fc338bf040b8718057717d2681f800d5e26ba59d))
## 15.3.3 (2021-09-07)
## 15.3.2 (2021-09-07)
## 15.3.1 (2021-09-07)
# 15.3.0 (2021-09-06)
# 15.1.0 (2021-08-02)
# 15.0.0 (2021-06-15)
### Bug Fixes
- **slatejs-adapter:** release as public package ([#227](https://github.com/contentful/rich-text/issues/227)) ([0ba8197](https://github.com/contentful/rich-text/commit/0ba81974a732bc6a32109b84e688e0903cc3632c))
# 14.2.0 (2021-05-04)
### Features
- {wip} update slate.js adapter ([c281aea](https://github.com/contentful/rich-text/commit/c281aea098e949c45ed08dd6b46babfc0a75bfb9))
- fix test types ([0c86f93](https://github.com/contentful/rich-text/commit/0c86f9362f551cf8a2fcbeacfd995052a93a936a))
- update contentful-to-slatejs adapter ([33a3b6d](https://github.com/contentful/rich-text/commit/33a3b6d69c118e53b7b8464e1c41d9da26edf8d9))
- update contentful-to-slatejs-adapter ([89a32f4](https://github.com/contentful/rich-text/commit/89a32f494e434fa63b70146da29a81e24fae3cea))
## 14.1.2 (2020-11-02)
### Bug Fixes
- 🐛 skip lib check for TS ([e8bf2ba](https://github.com/contentful/rich-text/commit/e8bf2ba61be9f36f104d0e0337829ac07b30eec6))
### Performance Improvements
- ⚡️ Remove lodash.omit dependency ([93b6b76](https://github.com/contentful/rich-text/commit/93b6b765488a6d3e003a832c953ae10c3f68672e))
## [15.15.1](https://github.com/contentful/rich-text/compare/v15.15.0...v15.15.1) (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# [15.15.0](https://github.com/contentful/rich-text/compare/v15.14.1...v15.15.0) (2022-11-29)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.14.1](https://github.com/contentful/rich-text/compare/v15.14.0...v15.14.1) (2022-11-23)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.14.0](https://github.com/contentful/rich-text/compare/v15.13.2...v15.14.0) (2022-11-14)
### Features
- add super/sub script types ([#391](https://github.com/contentful/rich-text/issues/391)) ([2562f66](https://github.com/contentful/rich-text/commit/2562f66278f0eff4eeeb367025d4b465773893d1))
## [15.13.2](https://github.com/contentful/rich-text/compare/v15.13.1...v15.13.2) (2022-09-07)
### Bug Fixes
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
- update Lerna, rollup in slatejs-adapter ([#366](https://github.com/contentful/rich-text/issues/366)) ([32448e3](https://github.com/contentful/rich-text/commit/32448e369ae2b76601dd81839e13c15432430d68))
## [15.13.1](https://github.com/contentful/rich-text/compare/v15.13.0...v15.13.1) (2022-05-10)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.12.1](https://github.com/contentful/rich-text/compare/v15.12.0...v15.12.1) (2022-04-21)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.12.0](https://github.com/contentful/rich-text/compare/v15.11.2...v15.12.0) (2022-03-25)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.11.1](https://github.com/contentful/rich-text/compare/v15.11.0...v15.11.1) (2022-01-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.11.0](https://github.com/contentful/rich-text/compare/v15.10.1...v15.11.0) (2021-12-27)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.10.1](https://github.com/contentful/rich-text/compare/v15.10.0...v15.10.1) (2021-12-21)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.10.0](https://github.com/contentful/rich-text/compare/v15.9.1...v15.10.0) (2021-12-15)
### Features
- support custom error transformer ([#296](https://github.com/contentful/rich-text/issues/296)) ([9449b87](https://github.com/contentful/rich-text/commit/9449b87fc063a00f11cfe7b2bc0fdb4d91251c69))
## [15.9.1](https://github.com/contentful/rich-text/compare/v15.9.0...v15.9.1) (2021-12-10)
### Bug Fixes
- **rich-text-types:** resolve generated JSON schemas ([#294](https://github.com/contentful/rich-text/issues/294)) ([1e5b4c4](https://github.com/contentful/rich-text/commit/1e5b4c474e1e27e97df177748c0c8df365a2ab71))
# [15.9.0](https://github.com/contentful/rich-text/compare/v15.8.0...v15.9.0) (2021-12-09)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.8.0](https://github.com/contentful/rich-text/compare/v15.7.0...v15.8.0) (2021-11-11)
### Features
- add toContentfulDocument() and toSlatejsDocument() empty block node handling ([#287](https://github.com/contentful/rich-text/issues/287)) ([fa79626](https://github.com/contentful/rich-text/commit/fa79626e4020d9640a920ca5d0ccb654e89cfa90))
# [15.7.0](https://github.com/contentful/rich-text/compare/v15.6.2...v15.7.0) (2021-11-11)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.6.1](https://github.com/contentful/rich-text/compare/v15.6.0...v15.6.1) (2021-11-05)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.6.0](https://github.com/contentful/rich-text/compare/v15.5.1...v15.6.0) (2021-11-04)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.5.0](https://github.com/contentful/rich-text/compare/v15.4.0...v15.5.0) (2021-10-25)
### Features
- add v1 node types constraints ([#279](https://github.com/contentful/rich-text/issues/279)) ([5026023](https://github.com/contentful/rich-text/commit/5026023610ec1439f24fd32df9977c2cd4c13e86))
## [15.3.5](https://github.com/contentful/rich-text/compare/v15.3.4...v15.3.5) (2021-09-13)
### Bug Fixes
- **rich-text-types:** forbid Tables inside ListItem ([#266](https://github.com/contentful/rich-text/issues/266)) ([fc338bf](https://github.com/contentful/rich-text/commit/fc338bf040b8718057717d2681f800d5e26ba59d))
## [15.3.3](https://github.com/contentful/rich-text/compare/v15.3.2...v15.3.3) (2021-09-07)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.3.2](https://github.com/contentful/rich-text/compare/v15.3.1...v15.3.2) (2021-09-07)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
## [15.3.1](https://github.com/contentful/rich-text/compare/v15.3.0...v15.3.1) (2021-09-07)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [15.2.0](https://github.com/contentful/rich-text/compare/v15.2.0...v15.1.0) (2021-09-06)
# [15.1.0](https://github.com/contentful/rich-text/compare/v15.0.0...v15.1.0) (2021-08-02)
# [15.0.0](https://github.com/contentful/rich-text/compare/v14.2.0...v15.0.0) (2021-06-15)
### Bug Fixes
- **slatejs-adapter:** release as public package ([#227](https://github.com/contentful/rich-text/issues/227)) ([0ba8197](https://github.com/contentful/rich-text/commit/0ba81974a732bc6a32109b84e688e0903cc3632c))
# [15.3.0](https://github.com/contentful/rich-text/compare/v15.2.0...v15.3.0) (2021-09-06)
**Note:** Version bump only for package @contentful/contentful-slatejs-adapter
# [14.2.0](https://github.com/contentful/rich-text/compare/v14.1.3...v14.2.0) (2021-05-04)
### Features
- {wip} update slate.js adapter ([c281aea](https://github.com/contentful/rich-text/commit/c281aea098e949c45ed08dd6b46babfc0a75bfb9))
- fix test types ([0c86f93](https://github.com/contentful/rich-text/commit/0c86f9362f551cf8a2fcbeacfd995052a93a936a))
- update contentful-to-slatejs adapter ([33a3b6d](https://github.com/contentful/rich-text/commit/33a3b6d69c118e53b7b8464e1c41d9da26edf8d9))
- update contentful-to-slatejs-adapter ([89a32f4](https://github.com/contentful/rich-text/commit/89a32f494e434fa63b70146da29a81e24fae3cea))
## [14.1.2](https://github.com/contentful/rich-text/compare/v14.0.1...v14.1.2) (2020-11-02)
### Bug Fixes
- 🐛 skip lib check for TS ([e8bf2ba](https://github.com/contentful/rich-text/commit/e8bf2ba61be9f36f104d0e0337829ac07b30eec6))
### Performance Improvements
- ⚡️ Remove lodash.omit dependency ([93b6b76](https://github.com/contentful/rich-text/commit/93b6b765488a6d3e003a832c953ae10c3f68672e))
================================================
FILE: packages/contentful-slatejs-adapter/README.md
================================================
# contentful-slatejs-adapter
This library provides an adapter to convert Slate's document structure to Contentful's rich text document structure and vice-versa.
## Installation
Using [npm](http://npmjs.org/):
```sh
npm install @contentful/contentful-slatejs-adapter
```
Using [yarn](https://yarnpkg.com/):
```sh
yarn add @contentful/contentful-slatejs-adapter
```
## Usage
_TBA_
```json
{
"category": "document",
"content": [
{
"category": "block",
"type": "header-one",
"content": [
{
"category": "text",
"type": "text",
"value": "This is a headline!",
"marks": [
{
"object": "mark",
"type": "bold",
"data": {}
}
]
}
]
},
{
"category": "block",
"type": "paragraph",
"content": [
{
"category": "text",
"type": "text",
"value": "",
"marks": [
{
"object": "mark",
"type": "bold",
"data": {}
}
]
}
]
},
{
"category": "block",
"type": "paragraph",
"content": [
{
"category": "text",
"type": "text",
"value": "and this is a bold text",
"marks": [
{
"object": "mark",
"type": "bold",
"data": {}
}
]
},
{
"category": "text",
"type": "text",
"value": " but now i am not bold anymore. ",
"marks": []
},
{
"category": "text",
"type": "text",
"value": "However, ",
"marks": [
{
"object": "mark",
"type": "italic",
"data": {}
}
]
},
{
"category": "text",
"type": "text",
"value": " i am now ",
"marks": []
},
{
"category": "text",
"type": "text",
"value": "underlined with shit. ",
"marks": [
{
"object": "mark",
"type": "underlined",
"data": {}
}
]
}
]
}
]
}
```
================================================
FILE: packages/contentful-slatejs-adapter/jest.config.js
================================================
const getBaseConfig = require('../../baseJestConfig');
const package = require('./package.json');
const packageName = package.name.split('@contentful/')[1];
module.exports = {
...getBaseConfig(packageName),
};
================================================
FILE: packages/contentful-slatejs-adapter/package.json
================================================
{
"name": "@contentful/contentful-slatejs-adapter",
"version": "16.2.1",
"description": "",
"keywords": [],
"main": "dist/contentful-slatejs-adapter.es5.js",
"module": "dist/contentful-slatejs-adapter.esm.js",
"typings": "dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/contentful-slatejs-adapter.esm.js",
"require": "./dist/contentful-slatejs-adapter.es5.js",
"default": "./dist/contentful-slatejs-adapter.es5.js"
},
"./package.json": "./package.json"
},
"files": [
"dist"
],
"author": "Contentful GmbH",
"repository": {
"type": "git",
"url": "https://github.com/contentful/rich-text.git"
},
"license": "MIT",
"engines": {
"node": ">=6.0.0"
},
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc && rollup -c --bundleConfigAsCjs rollup.config.ts",
"start": "rollup -c --bundleConfigAsCjs rollup.config.ts -w",
"test": "jest",
"test:watch": "jest --watch",
"test:prod": "yarn test -- --coverage --no-cache",
"report-coverage": "cat ./coverage/lcov.info | coveralls"
},
"dependencies": {
"@contentful/rich-text-types": "^17.2.7"
},
"devDependencies": {
"@faker-js/faker": "^10.0.0",
"@types/jest": "^30.0.0",
"@types/node": "^25.0.2",
"colors": "^1.1.2",
"coveralls": "^3.0.0",
"cross-env": "^10.0.0",
"cz-conventional-changelog": "^3.3.0",
"lodash.camelcase": "^4.3.0",
"prompt": "^1.0.0",
"ts-jest": "^29.1.2"
},
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com/"
}
}
================================================
FILE: packages/contentful-slatejs-adapter/rollup.config.ts
================================================
import config from '../../rollup.config';
import { main as outputFile, dependencies } from './package.json';
export default config(outputFile, {
external: Object.keys(dependencies),
});
================================================
FILE: packages/contentful-slatejs-adapter/src/__test__/contentful-helpers.ts
================================================
import {
BLOCKS,
INLINES,
Document,
Block,
Inline,
Text,
Mark,
TopLevelBlock,
TopLevelBlockEnum,
} from '@contentful/rich-text-types';
export interface NodeProps {
isVoid?: boolean;
data?: Record<string, any>;
}
export function document(...content: TopLevelBlock[]): Document {
return {
data: {},
nodeType: BLOCKS.DOCUMENT,
content,
};
}
export function block(
nodeType: TopLevelBlockEnum,
...content: Array<Block | Inline | Text>
): TopLevelBlock;
export function block(nodeType: BLOCKS, ...content: Array<Block | Inline | Text>): Block;
export function block(nodeType: BLOCKS, ...content: Array<Block | Inline | Text>): Block {
return {
nodeType,
content,
data: {},
};
}
export function inline(nodeType: INLINES, ...content: Array<Inline | Text>): Inline {
return {
nodeType,
content,
data: {},
};
}
export function text(value: string, ...marks: Mark[]): Text {
return {
nodeType: 'text',
data: {},
marks,
value: value,
};
}
export function mark(type: string): Mark {
return {
type,
};
}
================================================
FILE: packages/contentful-slatejs-adapter/src/__test__/contentful-to-slatejs-adapter.test.ts
================================================
import * as Contentful from '@contentful/rich-text-types';
import toSlatejsDocument from '../contentful-to-slatejs-adapter';
import toContentfulDocument from '../slatejs-to-contentful-adapter';
import { SlateNode } from '../types';
import * as contentful from './contentful-helpers';
const schema = { blocks: { [Contentful.BLOCKS.EMBEDDED_ENTRY]: { isVoid: true } } };
describe('both adapters (roundtrippable cases)', () => {
const testAdapters = (
message: string,
contentfulDoc: Contentful.Document,
slateDoc: SlateNode[],
) => {
describe('toSlatejsDocument()', () => {
it(message, () => {
const actualSlateDoc = toSlatejsDocument({
document: contentfulDoc,
schema,
});
expect(actualSlateDoc).toEqual(slateDoc);
});
it('converts Contentful mentions to Slate mentions', () => {
const contentfulInput = {
content: [
{
content: [
{ data: {}, marks: [], nodeType: 'text', value: 'Hello ' },
{
content: [{ data: {}, marks: [], nodeType: 'text', value: '' }],
data: { target: { sys: { id: 'user-id-0', linkType: 'User', type: 'Link' } } },
nodeType: 'mention',
},
{ data: {}, marks: [], nodeType: 'text', value: '' },
],
data: {},
nodeType: 'paragraph',
},
],
data: {},
nodeType: 'document',
};
const slateOutput = toSlatejsDocument({
document: contentfulInput as unknown as Contentful.Document,
});
const expectedSlateOutput = [
{
type: 'paragraph',
isVoid: false,
data: {},
children: [
{
data: {},
text: 'Hello ',
},
{
type: 'mention',
isVoid: false,
data: {
target: {
sys: {
type: 'Link',
linkType: 'User',
id: 'user-id-0',
},
},
},
children: [
{
data: {},
text: '',
},
],
},
{
data: {},
text: '',
},
],
},
];
expect(slateOutput).toStrictEqual(expectedSlateOutput);
});
});
describe('toContentfulDocument()', () => {
it(message, () => {
const actualContentfulDoc = toContentfulDocument({
document: slateDoc,
schema,
});
expect(actualContentfulDoc).toEqual(contentfulDoc);
});
it('is converts Slate mentions to Contentful mentions', () => {
const slateFormatWithMention = [
{
type: 'paragraph',
data: {},
children: [
{
text: 'Hello ',
},
{
type: 'mention',
data: {
target: {
sys: {
type: 'Link',
linkType: 'User',
id: 'user-id-0',
},
},
},
children: [
{
text: '',
},
],
},
{
text: '',
},
],
},
];
const resultContentfulDoc = toContentfulDocument({
document: slateFormatWithMention as unknown as SlateNode[],
schema,
});
const expectedContentfulDoc = {
content: [
{
content: [
{ data: {}, marks: [], nodeType: 'text', value: 'Hello ' },
{
content: [{ data: {}, marks: [], nodeType: 'text', value: '' }],
data: { target: { sys: { id: 'user-id-0', linkType: 'User', type: 'Link' } } },
nodeType: 'mention',
},
{ data: {}, marks: [], nodeType: 'text', value: '' },
],
data: {},
nodeType: 'paragraph',
},
],
data: {},
nodeType: 'document',
};
expect(resultContentfulDoc).toEqual(expectedContentfulDoc);
});
it('converts text-only nodes', () => {
const slateText = [
{
type: 'paragraph',
data: {},
children: [
{
text: 'Hello ',
},
],
},
];
const convertedToContentful = toContentfulDocument({
document: slateText as unknown as SlateNode[],
});
const expectedContentfulDoc = {
content: [
{
content: [{ data: {}, marks: [], nodeType: 'text', value: 'Hello ' }],
data: {},
nodeType: 'paragraph',
},
],
data: {},
nodeType: 'document',
};
expect(convertedToContentful).toStrictEqual(expectedContentfulDoc);
});
});
};
describe('document', () => {
testAdapters('empty document', contentful.document(), []);
testAdapters(
'document with block',
contentful.document(contentful.block(Contentful.BLOCKS.PARAGRAPH, contentful.text(''))),
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [
{
text: '',
data: {},
},
],
},
],
);
testAdapters(
'paragraph with inline',
contentful.document(
contentful.block(
Contentful.BLOCKS.PARAGRAPH,
contentful.inline(Contentful.INLINES.HYPERLINK),
),
),
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [
{
type: Contentful.INLINES.HYPERLINK,
data: {},
isVoid: false,
children: [],
},
],
},
],
);
testAdapters(
'paragraph with text',
contentful.document(contentful.block(Contentful.BLOCKS.PARAGRAPH, contentful.text('hi'))),
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [{ text: 'hi', data: {} }],
},
],
);
testAdapters(
'text with marks',
contentful.document(
contentful.block(
Contentful.BLOCKS.PARAGRAPH,
contentful.text('this'),
contentful.text('is', contentful.mark('bold')),
),
),
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [
{ text: 'this', data: {} },
{ text: 'is', data: {}, bold: true },
],
},
],
);
it('adds a default value to marks if undefined', () => {
const slateDoc = [
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [{ text: 'Hi', data: {} }],
},
];
const ctflDoc = toContentfulDocument({
document: slateDoc,
});
expect(ctflDoc).toEqual(
contentful.document(
contentful.block(Contentful.BLOCKS.PARAGRAPH, {
nodeType: 'text',
marks: [],
data: {},
value: 'Hi',
}),
),
);
});
testAdapters(
'text with multiple marks',
contentful.document(
contentful.block(
Contentful.BLOCKS.PARAGRAPH,
contentful.text('this'),
contentful.text('is', contentful.mark('bold')),
contentful.text('huge', contentful.mark('bold'), contentful.mark('italic')),
),
),
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [
{ text: 'this', data: {} },
{ text: 'is', data: {}, bold: true },
{ text: 'huge', data: {}, bold: true, italic: true },
],
},
],
);
testAdapters(
'document with nested blocks',
contentful.document(
contentful.block(
Contentful.BLOCKS.PARAGRAPH,
contentful.text('this is a test', contentful.mark('bold')),
contentful.text('paragraph', contentful.mark('underline')),
),
contentful.block(
Contentful.BLOCKS.QUOTE,
contentful.block(Contentful.BLOCKS.PARAGRAPH, contentful.text('this is it')),
),
),
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [
{ text: 'this is a test', data: {}, bold: true },
{ text: 'paragraph', data: {}, underline: true },
],
},
{
type: Contentful.BLOCKS.QUOTE,
data: {},
isVoid: false,
children: [
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [{ text: 'this is it', data: {} }],
},
],
},
],
);
});
describe('converts additional data', () => {
testAdapters(
'data in block',
{
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.PARAGRAPH,
content: [
{
nodeType: 'text',
marks: [],
data: {},
value: '',
},
],
data: { a: 1 },
},
],
},
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: { a: 1 },
isVoid: false,
children: [{ text: '', data: {} }],
},
],
);
testAdapters(
'data in inline',
{
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.PARAGRAPH,
data: { a: 1 },
content: [
{
nodeType: Contentful.INLINES.HYPERLINK,
data: { a: 2 },
content: [],
},
],
},
],
},
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: { a: 1 },
isVoid: false,
children: [
{
type: Contentful.INLINES.HYPERLINK,
data: { a: 2 },
isVoid: false,
children: [],
},
],
},
],
);
testAdapters(
'data in text',
{
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.PARAGRAPH,
data: { a: 1 },
content: [
{
nodeType: Contentful.INLINES.HYPERLINK,
data: { a: 2 },
content: [
{
nodeType: 'text',
marks: [],
data: { a: 3 },
value: 'YO',
},
],
},
],
},
],
},
[
{
type: Contentful.BLOCKS.PARAGRAPH,
data: { a: 1 },
isVoid: false,
children: [
{
type: Contentful.INLINES.HYPERLINK,
data: { a: 2 },
isVoid: false,
children: [
{
text: 'YO',
data: { a: 3 },
},
],
},
],
},
],
);
});
describe('sets isVoid from schema', () => {
testAdapters(
'data in block',
{
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.EMBEDDED_ENTRY,
content: [],
data: { a: 1 },
},
],
},
[
{
type: Contentful.BLOCKS.EMBEDDED_ENTRY,
data: { a: 1 },
isVoid: true,
children: [],
},
],
);
test('removes empty text nodes from void nodes content', () => {
const contentfulDoc: Contentful.Document = {
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.EMBEDDED_ENTRY,
content: [],
data: { a: 1 },
},
],
};
const slateDoc = [
{
type: Contentful.BLOCKS.EMBEDDED_ENTRY,
data: { a: 1 },
isVoid: true,
children: [{ text: '', data: {} }],
},
];
const actualContentfulDoc = toContentfulDocument({
document: slateDoc,
schema,
});
expect(actualContentfulDoc).toEqual(contentfulDoc);
});
});
});
describe('toSlatejsDocument() adapter (non-roundtrippable cases)', () => {
// `content` for any TEXT_CONTAINER contentful node could be empty according to our
// validation rules, but SlateJS could crash if there isn't a text leaf.
it('inserts empty text nodes into text container blocks with empty `content`', () => {
const cfDoc = {
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.PARAGRAPH,
content: [] as any,
data: {},
},
{
nodeType: Contentful.BLOCKS.HEADING_1,
content: [] as any,
data: {},
},
{
nodeType: Contentful.BLOCKS.HEADING_6,
content: [] as any,
data: { a: 42 },
},
],
} as Contentful.Document;
const expectedSlateDoc = [
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [{ text: '', data: {} }],
},
{
type: Contentful.BLOCKS.HEADING_1,
data: {},
isVoid: false,
children: [{ text: '', data: {} }],
},
{
type: Contentful.BLOCKS.HEADING_6,
data: { a: 42 },
isVoid: false,
children: [{ text: '', data: {} }],
},
];
const actualSlateDoc = toSlatejsDocument({
document: cfDoc,
schema,
});
expect(actualSlateDoc).toEqual(expectedSlateDoc);
});
});
describe('toContentfulDocument()}; adapter (non-roundtrippable cases)', () => {
it('neither inserts nor removes empty text nodes on container blocks with empty `children`', () => {
const slateDoc = [
{
type: Contentful.BLOCKS.HEADING_1,
data: {},
isVoid: false,
children: [{ text: '', data: {} }],
},
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [{ text: '', data: {} }],
},
{
type: Contentful.BLOCKS.PARAGRAPH,
data: {},
isVoid: false,
children: [],
},
{
type: Contentful.BLOCKS.HEADING_2,
data: {},
isVoid: false,
children: [],
},
];
const expectedCfDoc = {
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: Contentful.BLOCKS.HEADING_1,
content: [
{
nodeType: 'text',
marks: [] as any,
data: {},
value: '',
},
],
data: {},
},
{
nodeType: Contentful.BLOCKS.PARAGRAPH,
content: [
{
nodeType: 'text',
marks: [],
data: {},
value: '',
},
],
data: {},
},
{
nodeType: Contentful.BLOCKS.PARAGRAPH,
content: [
{
nodeType: 'text',
marks: [],
data: {},
value: '',
},
],
data: {},
},
{
nodeType: Contentful.BLOCKS.HEADING_2,
content: [
{
nodeType: 'text',
marks: [],
data: {},
value: '',
},
],
data: {},
},
],
};
const actualCfDoc = toContentfulDocument({
document: slateDoc,
schema,
});
expect(actualCfDoc).toEqual(expectedCfDoc);
});
});
================================================
FILE: packages/contentful-slatejs-adapter/src/contentful-to-slatejs-adapter.ts
================================================
import * as Contentful from '@contentful/rich-text-types';
import { getDataOrDefault } from './helpers';
import { fromJSON, Schema, SchemaJSON } from './schema';
import {
ContentfulElementNode,
ContentfulNode,
SlateElement,
SlateMarks,
SlateNode,
SlateText,
} from './types';
export interface ToSlatejsDocumentProperties {
document: Contentful.Document;
schema?: SchemaJSON;
}
export default function toSlatejsDocument({
document,
schema,
}: ToSlatejsDocumentProperties): SlateNode[] {
// TODO:
// We allow adding data to the root document node, but Slate >v0.5.0
// has no concept of a root document node. We should determine whether
// this will be a compatibility problem for existing users.
return document.content.flatMap((node) => convertNode(node, fromJSON(schema)));
}
function convertNode(node: ContentfulNode, schema: Schema): SlateNode {
if (node.nodeType === 'text') {
return convertTextNode(node as Contentful.Text);
} else {
const contentfulNode = node as ContentfulElementNode;
const childNodes = contentfulNode.content.flatMap((childNode) =>
convertNode(childNode, schema),
);
const slateNode = convertElementNode(contentfulNode, childNodes, schema);
return slateNode;
}
}
function convertElementNode(
contentfulBlock: ContentfulElementNode,
slateChildren: SlateNode[],
schema: Schema,
): SlateElement {
const children =
slateChildren.length === 0 && schema.isTextContainer(contentfulBlock.nodeType)
? [{ text: '', data: {} }]
: slateChildren;
return {
type: contentfulBlock.nodeType,
children,
isVoid: schema.isVoid(contentfulBlock),
data: getDataOrDefault(contentfulBlock.data),
};
}
function convertTextNode(node: Contentful.Text): SlateText {
return {
text: node.value,
data: getDataOrDefault(node.data),
...convertTextMarks(node),
};
}
function convertTextMarks(node: Contentful.Text): SlateMarks {
const marks: SlateMarks = {};
for (const mark of node.marks) {
marks[mark.type as keyof SlateMarks] = true;
}
return marks;
}
================================================
FILE: packages/contentful-slatejs-adapter/src/helpers.ts
================================================
/**
* Ensures that data defaults to an empty object.
*/
export const getDataOrDefault = (value?: Record<string, any>) => value || {};
================================================
FILE: packages/contentful-slatejs-adapter/src/index.ts
================================================
export { default as toSlatejsDocument } from './contentful-to-slatejs-adapter';
export { default as toContentfulDocument } from './slatejs-to-contentful-adapter';
================================================
FILE: packages/contentful-slatejs-adapter/src/schema.ts
================================================
import { BLOCKS, TEXT_CONTAINERS } from '@contentful/rich-text-types';
import { ContentfulElementNode } from './types';
const defaultSchema: SchemaJSON = {};
// TODO: Get rid of outdated SlateJS schema concept here and instead construct
// a `Schema` object based on `rich-text-types` constants. The original idea
// was to decouple code from these constants for future extensibility cases
// where we had to deal with custom node types that wouldn't be part of these
// constants while a custom (forked) rich-text editor provided `Schema`
// instance would be aware of them.
/**
* SlateJS Schema definition v0.33.x
*
* @export
* @interface SchemaJSON
*/
export interface SchemaJSON {
blocks?: Record<string, SchemaValue>;
inlines?: Record<string, SchemaValue>;
}
// TODO: No need to extend `SchemaJSON` and change `isVoid` to take a `nodeType: string`
export interface Schema extends SchemaJSON {
isVoid(node: ContentfulElementNode): boolean;
isTextContainer(nodeType: string): boolean;
}
export interface SchemaValue {
isVoid?: boolean;
[k: string]: any;
}
/**
* Creates an instance of Schema from json.
*
* @export
* @param {SchemaJSON} [schema=defaultSchema]
* @returns {Schema}
*/
export function fromJSON(schema: SchemaJSON = defaultSchema): Schema {
return {
/**
* Check if a `node` is void based on the schema rules.
*
* @param {ContentfulElementNode} node
* @returns
*/
isVoid(node: ContentfulElementNode) {
const root = Object.values(BLOCKS).includes(node.nodeType as any) ? 'blocks' : 'inlines';
return schema?.[root]?.[node.nodeType]?.['isVoid'] ?? false;
},
isTextContainer(nodeType: string) {
return TEXT_CONTAINERS.includes(nodeType as any);
},
};
}
================================================
FILE: packages/contentful-slatejs-adapter/src/slatejs-to-contentful-adapter.ts
================================================
import * as Contentful from '@contentful/rich-text-types';
import { getDataOrDefault } from './helpers';
import { Schema, SchemaJSON, fromJSON } from './schema';
import {
ContentfulElementNode,
ContentfulNode,
SlateElement,
SlateMarks,
SlateNode,
SlateText,
} from './types';
export interface ToContentfulDocumentProperties {
document: SlateNode[];
schema?: SchemaJSON;
}
export default function toContentfulDocument({
document,
schema,
}: ToContentfulDocumentProperties): Contentful.Document {
// TODO:
// We allow adding data to the root document node, but Slate >v0.5.0
// has no concept of a root document node. We should determine whether
// this will be a compatibility problem for existing users.
return {
nodeType: Contentful.BLOCKS.DOCUMENT,
data: {},
content: document.flatMap(
(node) => convertNode(node, fromJSON(schema)) as Contentful.TopLevelBlock[],
),
};
}
function convertNode(node: SlateNode, schema: Schema): ContentfulNode[] {
const nodes: ContentfulNode[] = [];
if (isSlateElement(node)) {
const contentfulElement: ContentfulElementNode = {
nodeType: node.type as Contentful.BLOCKS,
data: getDataOrDefault(node.data),
content: [],
};
if (!schema.isVoid(contentfulElement)) {
contentfulElement.content = node.children.flatMap((childNode) =>
convertNode(childNode, schema),
);
}
if (contentfulElement.content.length === 0 && schema.isTextContainer(node.type)) {
contentfulElement.content.push(convertText({ text: '', data: {} }));
}
nodes.push(contentfulElement);
} else {
const contentfulText = convertText(node);
nodes.push(contentfulText);
}
return nodes;
}
function convertText(node: SlateText): Contentful.Text {
const { text, data, ...marks } = node;
return {
nodeType: 'text',
value: text,
marks: getMarkList(marks),
data: getDataOrDefault(data),
};
}
function getMarkList(marks: SlateMarks): Contentful.Mark[] {
const contentfulMarks: Contentful.Mark[] = [];
for (const mark of Object.keys(marks)) {
contentfulMarks.push({ type: mark });
}
return contentfulMarks;
}
function isSlateElement(node: SlateNode): node is SlateElement {
return 'type' in node;
}
================================================
FILE: packages/contentful-slatejs-adapter/src/types/index.ts
================================================
import * as Contentful from '@contentful/rich-text-types';
export type SlateMarks = {
// This is a workaround for TypeScript's limitations around
// index property exclusion. Ideally we'd join the above properties
// with something like
//
// & { [mark: string]: string }
//
// but TypeScript doesn't allow us to create such objects, only
// work around inconsistencies in existing JavaScript.
//
// In reality Slate's node marks are arbitrary, but for this library
// denoting marks used by the tests as optional should be okay.
bold?: boolean;
italic?: boolean;
underline?: boolean;
};
export type SlateText = SlateMarks & {
text: string;
data: object;
};
export type SlateElement = {
type: string;
data: object;
isVoid: boolean;
children: SlateNode[];
};
export type ContentfulElementNode = Contentful.Block | Contentful.Inline;
export type ContentfulNode = ContentfulElementNode | Contentful.Text;
export type SlateNode = SlateElement | SlateText;
================================================
FILE: packages/contentful-slatejs-adapter/src/types/slate.ts
================================================
/* eslint-disable */
namespace Slate {
// fixes "Duplicate identifier" when generating tests coverage
export type NodeObject = 'document' | 'block' | 'inline' | 'text';
export interface Node {
object: NodeObject;
type?: string;
data?: object;
isVoid?: boolean;
}
export interface Document extends Node {
object: 'document';
nodes: Block[];
}
export interface Block extends Node {
object: 'block';
nodes: Array<Block | Inline | Text>;
}
export interface Inline extends Node {
object: 'inline';
nodes: Array<Inline | Text>;
}
export interface Text extends Node {
object: 'text';
leaves: TextLeaf[];
}
export interface Mark {
type: string;
data: Record<string, any>;
object: 'mark';
}
export interface TextLeaf {
object: 'leaf';
text: string;
marks?: Mark[];
}
}
================================================
FILE: packages/contentful-slatejs-adapter/tsconfig.json
================================================
{
"compilerOptions": {
"moduleResolution": "node",
"target": "es5",
"module": "es2015",
"lib": ["es2015", "es2016", "es2017", "ES2019"],
"strict": true,
"sourceMap": true,
"declaration": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declarationDir": "dist/types",
"resolveJsonModule": true,
"outDir": "dist/lib",
"skipLibCheck": true,
"typeRoots": ["../../node_modules/@types", "node_modules/@types", "src/typings"],
"types": ["jest"]
},
"include": ["src"]
}
================================================
FILE: packages/rich-text-from-markdown/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [16.2.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.2.0...@contentful/rich-text-from-markdown@16.2.1) (2026-04-09)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [16.2.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.8...@contentful/rich-text-from-markdown@16.2.0) (2026-04-08)
### Features
- add esm support [ZEND-7778] ([#1069](https://github.com/contentful/rich-text/issues/1069)) ([8c320bd](https://github.com/contentful/rich-text/commit/8c320bde7fa313572bdad84b91a6fd12224afc3a)), closes [#1068](https://github.com/contentful/rich-text/issues/1068)
## [16.1.8](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.7...@contentful/rich-text-from-markdown@16.1.8) (2025-11-04)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.7](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.6...@contentful/rich-text-from-markdown@16.1.7) (2025-09-23)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.6](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.5...@contentful/rich-text-from-markdown@16.1.6) (2025-09-23)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.4...@contentful/rich-text-from-markdown@16.1.5) (2025-09-10)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.3...@contentful/rich-text-from-markdown@16.1.4) (2025-09-09)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.2...@contentful/rich-text-from-markdown@16.1.3) (2025-09-04)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.1...@contentful/rich-text-from-markdown@16.1.2) (2025-08-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [16.1.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.1.0...@contentful/rich-text-from-markdown@16.1.1) (2025-07-15)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [16.1.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.0.1...@contentful/rich-text-from-markdown@16.1.0) (2025-07-02)
### Features
- **markdown:** transform strikethrough to rich-text mark ([#883](https://github.com/contentful/rich-text/issues/883)) ([ac51579](https://github.com/contentful/rich-text/commit/ac51579f5e716bb15862796177a924c7e838edb6))
## [16.0.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@16.0.0...@contentful/rich-text-from-markdown@16.0.1) (2025-06-16)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [16.0.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.10...@contentful/rich-text-from-markdown@16.0.0) (2024-10-29)
### Features
- bring rich text validator [TOL-2426] ([#694](https://github.com/contentful/rich-text/issues/694)) ([30893a6](https://github.com/contentful/rich-text/commit/30893a68b171167502135b48258ba4b93c8375c7))
### BREAKING CHANGES
- removed getSchemaWithNodeType in favor of validateRichTextDocument
## [15.18.10](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.9...@contentful/rich-text-from-markdown@15.18.10) (2024-09-09)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.9](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.8...@contentful/rich-text-from-markdown@15.18.9) (2024-08-26)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.8](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.7...@contentful/rich-text-from-markdown@15.18.8) (2024-07-29)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.7](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.6...@contentful/rich-text-from-markdown@15.18.7) (2024-07-24)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.6](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.5...@contentful/rich-text-from-markdown@15.18.6) (2024-07-17)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.4...@contentful/rich-text-from-markdown@15.18.5) (2024-07-17)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.3...@contentful/rich-text-from-markdown@15.18.4) (2024-07-16)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.2...@contentful/rich-text-from-markdown@15.18.3) (2024-07-16)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.1...@contentful/rich-text-from-markdown@15.18.2) (2024-07-16)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.18.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.18.0...@contentful/rich-text-from-markdown@15.18.1) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.18.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.17.5...@contentful/rich-text-from-markdown@15.18.0) (2024-06-25)
### Features
- switch from tslint to eslint [TOL-2218][tol-2203] ([#594](https://github.com/contentful/rich-text/issues/594)) ([c077b5a](https://github.com/contentful/rich-text/commit/c077b5af58f94c8dc6af4715d4b82c2771d643c5))
## [15.17.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.17.4...@contentful/rich-text-from-markdown@15.17.5) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.17.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.17.3...@contentful/rich-text-from-markdown@15.17.4) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.17.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.17.2...@contentful/rich-text-from-markdown@15.17.3) (2024-05-28)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.17.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.17.1...@contentful/rich-text-from-markdown@15.17.2) (2024-05-27)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.17.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.17.0...@contentful/rich-text-from-markdown@15.17.1) (2024-05-24)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.17.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.15...@contentful/rich-text-from-markdown@15.17.0) (2024-05-22)
### Features
- upgrading rollup to latest version [TOL-2097] ([#559](https://github.com/contentful/rich-text/issues/559)) ([f14d197](https://github.com/contentful/rich-text/commit/f14d1974590d58f92bbf4cb56644095dba929ad9))
## [15.16.15](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.14...@contentful/rich-text-from-markdown@15.16.15) (2024-03-04)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.14](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.13...@contentful/rich-text-from-markdown@15.16.14) (2024-03-01)
### Bug Fixes
- support <br/> from markdown ([#536](https://github.com/contentful/rich-text/issues/536)) ([30a3668](https://github.com/contentful/rich-text/commit/30a36685f42c70c98ae4bfb514ba710812ec0824))
## [15.16.13](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.12...@contentful/rich-text-from-markdown@15.16.13) (2024-01-30)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.12](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.11...@contentful/rich-text-from-markdown@15.16.12) (2024-01-23)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.11](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.10...@contentful/rich-text-from-markdown@15.16.11) (2024-01-23)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.10](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.9...@contentful/rich-text-from-markdown@15.16.10) (2024-01-23)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.9](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.8...@contentful/rich-text-from-markdown@15.16.9) (2024-01-22)
### Bug Fixes
- [] Wrap inline nodes inside of a table cell in paragraph node ([#520](https://github.com/contentful/rich-text/issues/520)) ([6290f7d](https://github.com/contentful/rich-text/commit/6290f7dcae96c279d97e88ad65c42a080778fe73))
## [15.16.8](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.7...@contentful/rich-text-from-markdown@15.16.8) (2023-09-12)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.7](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.6...@contentful/rich-text-from-markdown@15.16.7) (2023-08-04)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.6](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.5...@contentful/rich-text-from-markdown@15.16.6) (2023-05-26)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.4...@contentful/rich-text-from-markdown@15.16.5) (2023-05-04)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.3...@contentful/rich-text-from-markdown@15.16.4) (2023-03-14)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.2...@contentful/rich-text-from-markdown@15.16.3) (2023-02-09)
### Bug Fixes
- update remark-parse to v9 to fix security issue of trim@0.0.1 ([#444](https://github.com/contentful/rich-text/issues/444)) ([f961a89](https://github.com/contentful/rich-text/commit/f961a8927d911b2653883601b3cfdcd1b255a60b))
## [15.16.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.1...@contentful/rich-text-from-markdown@15.16.2) (2022-12-01)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.16.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-from-markdown@15.16.0...@contentful/rich-text-from-markdown@15.16.1) (2022-12-01)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# 15.16.0 (2022-12-01)
## 15.15.1 (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# 15.15.0 (2022-11-29)
## 15.14.1 (2022-11-23)
# 15.14.0 (2022-11-14)
## 15.13.2 (2022-09-07)
### Bug Fixes
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
## 15.13.1 (2022-05-10)
### Bug Fixes
- **markdown:** handle empty table cells ([#329](https://github.com/contentful/rich-text/issues/329)) ([55a0a16](https://github.com/contentful/rich-text/commit/55a0a16a12700fefbe7e9727a7172043fd126fc5))
# 15.13.0 (2022-05-06)
### Features
- support converting tables from markdown to rich-text ([0abc0c6](https://github.com/contentful/rich-text/commit/0abc0c60b7e3e2683ebbb427b44847e6242f6e5e))
## 15.12.1 (2022-04-21)
# 15.12.0 (2022-03-25)
## 15.11.2 (2022-02-07)
### Bug Fixes
- set "typings" for rich-text-from-markdown ([1b3a15f](https://github.com/contentful/rich-text/commit/1b3a15f1cb15eacb6d1b15f2b79c5747e2d25618))
## 15.11.1 (2022-01-04)
# 15.11.0 (2021-12-27)
## 15.10.1 (2021-12-21)
### Bug Fixes
- remove support to convert tables from md to rich text ([a9d513c](https://github.com/contentful/rich-text/commit/a9d513c285e8cdedd384b89e195734dd3a8d2136))
# 15.10.0 (2021-12-15)
## 15.9.1 (2021-12-10)
# 15.9.0 (2021-12-09)
# 15.7.0 (2021-11-11)
## 15.6.2 (2021-11-05)
## 15.6.1 (2021-11-05)
# 15.6.0 (2021-11-04)
### Features
- add support to convert tables from md to rich text ([#284](https://github.com/contentful/rich-text/issues/284)) ([213a29c](https://github.com/contentful/rich-text/commit/213a29c78d48b3e63088999c4eed4891906d1719))
## 15.5.1 (2021-10-25)
# 15.5.0 (2021-10-25)
## 15.3.6 (2021-09-15)
## 15.3.5 (2021-09-13)
## 15.3.3 (2021-09-07)
## 15.3.2 (2021-09-07)
## 15.3.1 (2021-09-07)
# 15.3.0 (2021-09-06)
# 15.1.0 (2021-08-02)
# 15.0.0 (2021-06-15)
## 14.1.2 (2020-11-02)
## 14.0.1 (2020-01-30)
# 14.0.0 (2020-01-28)
# 13.4.0 (2019-08-01)
# 13.1.0 (2019-03-04)
## 13.0.1 (2019-02-11)
# 13.0.0 (2019-01-22)
# 12.2.0 (2018-12-20)
### Bug Fixes
- fix import path ([3f3edff](https://github.com/contentful/rich-text/commit/3f3edff8bc4f4463a701d0ae1d397fcf9acec325))
- ignore unsupported marks ([1757331](https://github.com/contentful/rich-text/commit/1757331a74f360353556a242a9fe20da131b9a59))
### Features
- 🎸 parse links inside marks ([11722cf](https://github.com/contentful/rich-text/commit/11722cfad85d5e15b10d2b18d3c831ec613922c3))
## 12.1.2 (2018-12-14)
## 12.1.1 (2018-12-12)
### Bug Fixes
- handle hyperlinks ([54508d4](https://github.com/contentful/rich-text/commit/54508d495adf5055e4089f54dd62f00f8be6be46))
# 12.1.0 (2018-12-12)
### Bug Fixes
- **async-handling:** move to promise-based api ([a07d3fc](https://github.com/contentful/rich-text/commit/a07d3fcbd99a2d80f86bc6dcf5cba01665221ebc))
## 12.0.1 (2018-12-04)
### Bug Fixes
- **from-markdown:** Fix list typos ([c392016](https://github.com/contentful/rich-text/commit/c392016e2f11628021cd27bff3447f548398c3b4))
- **parsing:** list item, (un)ordered list, links, quotes ([8a0c580](https://github.com/contentful/rich-text/commit/8a0c580306c154f1c1d6c2ba964c46d18881be12))
- **text:** Parse text nodes with marks correctly ([d489f90](https://github.com/contentful/rich-text/commit/d489f904a33726f42006b09871d15bcfbdd7e274))
# 12.0.0 (2018-11-29)
# 11.0.0 (2018-11-27)
# 10.3.0 (2018-11-26)
# 10.2.0 (2018-11-19)
### Features
- 🎸 Add rich-text-references ([363b4e5](https://github.com/contentful/rich-text/commit/363b4e509e94af0932fd7cece8e56beafe8d67d2))
# 10.1.0 (2018-11-16)
### Bug Fixes
- 🐛 removes obsolete fields from mark nodes ([b638a56](https://github.com/contentful/rich-text/commit/b638a56652520969d3ac898ac158be81a9788f67))
### Features
- 🎸 introduces top-level-block type ([a6bf35e](https://github.com/contentful/rich-text/commit/a6bf35e7c9ca35915a512de774b3a3fdc4c76e5d))
## 10.0.4 (2018-11-09)
## 10.0.3 (2018-11-09)
## 10.0.2 (2018-11-09)
## 10.0.1 (2018-11-08)
### Features
- **packages:** Add rich text from markdown package ([bc8ec41](https://github.com/contentful/rich-text/commit/bc8ec41f5615eabcc29031ee99da3f9c70b414b3))
## [15.15.1](https://github.com/contentful/rich-text/compare/v15.15.0...v15.15.1) (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# [15.15.0](https://github.com/contentful/rich-text/compare/v15.14.1...v15.15.0) (2022-11-29)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.14.1](https://github.com/contentful/rich-text/compare/v15.14.0...v15.14.1) (2022-11-23)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.14.0](https://github.com/contentful/rich-text/compare/v15.13.2...v15.14.0) (2022-11-14)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.13.2](https://github.com/contentful/rich-text/compare/v15.13.1...v15.13.2) (2022-09-07)
### Bug Fixes
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
## [15.13.1](https://github.com/contentful/rich-text/compare/v15.13.0...v15.13.1) (2022-05-10)
### Bug Fixes
- **markdown:** handle empty table cells ([#329](https://github.com/contentful/rich-text/issues/329)) ([55a0a16](https://github.com/contentful/rich-text/commit/55a0a16a12700fefbe7e9727a7172043fd126fc5))
# [15.13.0](https://github.com/contentful/rich-text/compare/v15.12.1...v15.13.0) (2022-05-06)
### Features
- support converting tables from markdown to rich-text ([0abc0c6](https://github.com/contentful/rich-text/commit/0abc0c60b7e3e2683ebbb427b44847e6242f6e5e))
## [15.12.1](https://github.com/contentful/rich-text/compare/v15.12.0...v15.12.1) (2022-04-21)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.12.0](https://github.com/contentful/rich-text/compare/v15.11.2...v15.12.0) (2022-03-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.11.2](https://github.com/contentful/rich-text/compare/v15.11.1...v15.11.2) (2022-02-07)
### Bug Fixes
- set "typings" for rich-text-from-markdown ([1b3a15f](https://github.com/contentful/rich-text/commit/1b3a15f1cb15eacb6d1b15f2b79c5747e2d25618))
## [15.11.1](https://github.com/contentful/rich-text/compare/v15.11.0...v15.11.1) (2022-01-04)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.11.0](https://github.com/contentful/rich-text/compare/v15.10.1...v15.11.0) (2021-12-27)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.10.1](https://github.com/contentful/rich-text/compare/v15.10.0...v15.10.1) (2021-12-21)
### Bug Fixes
- remove support to convert tables from md to rich text ([a9d513c](https://github.com/contentful/rich-text/commit/a9d513c285e8cdedd384b89e195734dd3a8d2136))
# [15.10.0](https://github.com/contentful/rich-text/compare/v15.9.1...v15.10.0) (2021-12-15)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.9.1](https://github.com/contentful/rich-text/compare/v15.9.0...v15.9.1) (2021-12-10)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.9.0](https://github.com/contentful/rich-text/compare/v15.8.0...v15.9.0) (2021-12-09)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.7.0](https://github.com/contentful/rich-text/compare/v15.6.2...v15.7.0) (2021-11-11)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.6.2](https://github.com/contentful/rich-text/compare/v15.6.1...v15.6.2) (2021-11-05)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.6.1](https://github.com/contentful/rich-text/compare/v15.6.0...v15.6.1) (2021-11-05)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.6.0](https://github.com/contentful/rich-text/compare/v15.5.1...v15.6.0) (2021-11-04)
### Features
- add support to convert tables from md to rich text ([#284](https://github.com/contentful/rich-text/issues/284)) ([213a29c](https://github.com/contentful/rich-text/commit/213a29c78d48b3e63088999c4eed4891906d1719))
## [15.5.1](https://github.com/contentful/rich-text/compare/v15.5.0...v15.5.1) (2021-10-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.5.0](https://github.com/contentful/rich-text/compare/v15.4.0...v15.5.0) (2021-10-25)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.3.6](https://github.com/contentful/rich-text/compare/v15.3.5...v15.3.6) (2021-09-15)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.3.5](https://github.com/contentful/rich-text/compare/v15.3.4...v15.3.5) (2021-09-13)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.3.3](https://github.com/contentful/rich-text/compare/v15.3.2...v15.3.3) (2021-09-07)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.3.2](https://github.com/contentful/rich-text/compare/v15.3.1...v15.3.2) (2021-09-07)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
## [15.3.1](https://github.com/contentful/rich-text/compare/v15.3.0...v15.3.1) (2021-09-07)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.3.0](https://github.com/contentful/rich-text/compare/v15.2.0...v15.3.0) (2021-09-06)
**Note:** Version bump only for package @contentful/rich-text-from-markdown
# [15.2.0](https://github.com/contentful/rich-text/compare/v15.2.0...v15.1.0) (2021-09-06)
# [15.1.0](https://github.com/contentful/rich-text/compare/v15.0.0...v15.1.0) (2021-08-02)
# [15.0.0](https://github.com/contentful/rich-text/compare/v14.2.0...v15.0.0) (2021-06-15)
## [14.1.2](https://github.com/contentful/rich-text/compare/v14.0.1...v14.1.2) (2020-11-02)
## [14.0.1](https://github.com/contentful/rich-text/compare/v14.0.0...v14.0.1) (2020-01-30)
# [14.0.0](https://github.com/contentful/rich-text/compare/v13.4.0...v14.0.0) (2020-01-28)
# [13.4.0](https://github.com/contentful/rich-text/compare/v13.3.0...v13.4.0) (2019-08-01)
# [13.1.0](https://github.com/contentful/rich-text/compare/v13.0.1...v13.1.0) (2019-03-04)
## [13.0.1](https://github.com/contentful/rich-text/compare/v13.0.0...v13.0.1) (2019-02-11)
# [13.0.0](https://github.com/contentful/rich-text/compare/v12.2.1...v13.0.0) (2019-01-22)
# [12.2.0](https://github.com/contentful/rich-text/compare/v12.1.2...v12.2.0) (2018-12-20)
### Bug Fixes
- fix import path ([3f3edff](https://github.com/contentful/rich-text/commit/3f3edff8bc4f4463a701d0ae1d397fcf9acec325))
- ignore unsupported marks ([1757331](https://github.com/contentful/rich-text/commit/1757331a74f360353556a242a9fe20da131b9a59))
### Features
- 🎸 parse links inside marks ([11722cf](https://github.com/contentful/rich-text/commit/11722cfad85d5e15b10d2b18d3c831ec613922c3))
## [12.1.2](https://github.com/contentful/rich-text/compare/v12.1.1...v12.1.2) (2018-12-14)
## [12.1.1](https://github.com/contentful/rich-text/compare/v12.1.0...v12.1.1) (2018-12-12)
### Bug Fixes
- handle hyperlinks ([54508d4](https://github.com/contentful/rich-text/commit/54508d495adf5055e4089f54dd62f00f8be6be46))
# [12.1.0](https://github.com/contentful/rich-text/compare/v12.0.4...v12.1.0) (2018-12-12)
### Bug Fixes
- **async-handling:** move to promise-based api ([a07d3fc](https://github.com/contentful/rich-text/commit/a07d3fcbd99a2d80f86bc6dcf5cba01665221ebc))
## [12.0.1](https://github.com/contentful/rich-text/compare/v12.0.0...v12.0.1) (2018-12-04)
### Bug Fixes
- **from-markdown:** Fix list typos ([c392016](https://github.com/contentful/rich-text/commit/c392016e2f11628021cd27bff3447f548398c3b4))
- **parsing:** list item, (un)ordered list, links, quotes ([8a0c580](https://github.com/contentful/rich-text/commit/8a0c580306c154f1c1d6c2ba964c46d18881be12))
- **text:** Parse text nodes with marks correctly ([d489f90](https://github.com/contentful/rich-text/commit/d489f904a33726f42006b09871d15bcfbdd7e274))
# [12.0.0](https://github.com/contentful/rich-text/compare/v11.0.0...v12.0.0) (2018-11-29)
# [11.0.0](https://github.com/contentful/rich-text/compare/v10.3.0...v11.0.0) (2018-11-27)
# [10.3.0](https://github.com/contentful/rich-text/compare/v10.2.0...v10.3.0) (2018-11-26)
# [10.2.0](https://github.com/contentful/rich-text/compare/v10.1.0...v10.2.0) (2018-11-19)
### Features
- 🎸 Add rich-text-references ([363b4e5](https://github.com/contentful/rich-text/commit/363b4e509e94af0932fd7cece8e56beafe8d67d2))
# [10.1.0](https://github.com/contentful/rich-text/compare/v10.0.5...v10.1.0) (2018-11-16)
### Bug Fixes
- 🐛 removes obsolete fields from mark nodes ([b638a56](https://github.com/contentful/rich-text/commit/b638a56652520969d3ac898ac158be81a9788f67))
### Features
- 🎸 introduces top-level-block type ([a6bf35e](https://github.com/contentful/rich-text/commit/a6bf35e7c9ca35915a512de774b3a3fdc4c76e5d))
## [10.0.4](https://github.com/contentful/rich-text/compare/v10.0.3...v10.0.4) (2018-11-09)
## [10.0.3](https://github.com/contentful/rich-text/compare/v10.0.2...v10.0.3) (2018-11-09)
## [10.0.2](https://github.com/contentful/rich-text/compare/v10.0.1...v10.0.2) (2018-11-09)
## [10.0.1](https://github.com/contentful/rich-text/compare/v10.0.0...v10.0.1) (2018-11-08)
### Features
- **packages:** Add rich text from markdown package ([bc8ec41](https://github.com/contentful/rich-text/commit/bc8ec41f5615eabcc29031ee99da3f9c70b414b3))
================================================
FILE: packages/rich-text-from-markdown/README.md
================================================
# rich-text-from-markdown
A library to convert markdown to Contentful Rich Text document format.
## Installation
Using [npm](http://npmjs.org/):
```sh
npm install @contentful/rich-text-from-markdown
```
Using [yarn](https://yarnpkg.com/):
```sh
yarn add @contentful/rich-text-from-markdown
```
## Usage
### Basic
```js
const { richTextFromMarkdown } = require('@contentful/rich-text-from-markdown');
const document = await richTextFromMarkdown('# Hello World');
```
### Advanced
The library will convert automatically the following markdown nodes:
- `paragraph`
- `heading`
- `text`
- `emphasis`
- `strong`
- `delete`
- `inlineCode`
- `link`
- `thematicBreak`
- `blockquote`
- `list`
- `listItem`
- `table`
- `tableRow`
- `tableCell`
If the markdown content has unsupported nodes like image `` you can add a callback as a second argument
and it will get called everytime an unsupported node is found. The return value of the callback will be the rich text representation
of that node.
#### Example:
```js
const { richTextFromMarkdown } = require('@contentful/rich-text-from-markdown');
// define your own type for unsupported nodes like asset
const document = await richTextFromMarkdown(
"",
(node) => ({
nodeType: 'embedded-[entry|asset]-[block|inline]',
content: [],
data: {
target: {
sys: {
type: 'Link',
linkType: 'Entry|Asset',
id: '.........',
},
},
},
}),
);
```
================================================
FILE: packages/rich-text-from-markdown/jest.config.js
================================================
const getBaseConfig = require('../../baseJestConfig');
const package = require('./package.json');
const packageName = package.name.split('@contentful/')[1];
module.exports = {
...getBaseConfig(packageName),
};
================================================
FILE: packages/rich-text-from-markdown/package.json
================================================
{
"name": "@contentful/rich-text-from-markdown",
"version": "16.2.1",
"description": "convert markdown to rich text",
"keywords": [
"rich-text",
"contentful",
"markdown"
],
"author": "Khaled Garbaya <khaled@contentful.com>",
"homepage": "https://github.com/contentful/rich-text#readme",
"license": "MIT",
"main": "dist/rich-text-from-markdown.es5.js",
"module": "dist/rich-text-from-markdown.esm.js",
"typings": "dist/types/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"import": "./dist/rich-text-from-markdown.esm.js",
"require": "./dist/rich-text-from-markdown.es5.js",
"default": "./dist/rich-text-from-markdown.es5.js"
},
"./package.json": "./package.json"
},
"directories": {
"src": "src",
"test": "__tests__"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/contentful/rich-text.git"
},
"publishConfig": {
"access": "public",
"registry": "https://npm.pkg.github.com/"
},
"scripts": {
"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c --bundleConfigAsCjs rollup.config.js",
"start": "tsc && rollup -c --bundleConfigAsCjs rollup.config.js -w",
"test": "jest"
},
"dependencies": {
"@contentful/rich-text-types": "^17.2.7",
"lodash": "^4.17.11",
"remark-gfm": "^1.0.0",
"remark-parse": "^9.0.0",
"unified": "^9.0.0"
},
"devDependencies": {
"@faker-js/faker": "^10.0.0",
"@types/lodash": "^4.14.172",
"ts-jest": "^29.1.2"
},
"bugs": {
"url": "https://github.com/contentful/rich-text/issues"
}
}
================================================
FILE: packages/rich-text-from-markdown/rollup.config.js
================================================
import config from '../../rollup.config';
import { main as outputFile, dependencies } from './package.json';
export default config(outputFile, {
external: Object.keys(dependencies),
});
================================================
FILE: packages/rich-text-from-markdown/src/__test__/helpers.ts
================================================
import {
TopLevelBlock,
Document,
BLOCKS,
Block,
Inline,
Text,
Mark,
} from '@contentful/rich-text-types';
export interface NodeProps {
data?: Record<string, any>;
}
const defaultProps: NodeProps = { data: {} };
export function document(props: NodeProps = defaultProps, ...content: TopLevelBlock[]): Document {
return {
nodeType: BLOCKS.DOCUMENT,
data: {},
content,
...props,
};
}
export function block<T extends Block>(
nodeType: BLOCKS,
props: NodeProps = defaultProps,
...content: Array<Block | Inline | Text>
): T {
return {
nodeType,
content,
data: {},
...props,
} as T;
}
export function inline(
nodeType: string,
props: NodeProps = defaultProps,
...content: Array<Inline | Text>
): Inline {
return {
nodeType,
data: {},
content,
...props,
} as Inline;
}
export function text(value: string, ...marks: Mark[]): Text {
return {
nodeType: 'text',
data: {},
marks,
value: value,
};
}
export function mark(type: string): Mark {
return {
type,
};
}
================================================
FILE: packages/rich-text-from-markdown/src/__test__/index.test.ts
================================================
import { BLOCKS, INLINES, MARKS } from '@contentful/rich-text-types';
import { richTextFromMarkdown } from '..';
import { block, document, inline, mark, text } from './helpers';
describe('rich-text-from-markdown', () => {
test('should parse some markdown', async () => {
const result = await richTextFromMarkdown('# Hello World');
expect(result).toEqual(document({}, block(BLOCKS.HEADING_1, {}, text('Hello World'))));
});
test('should call the fallback function when a node is not supported', async () => {
const fakeNode = { nodeType: 'image', data: {} };
const fallback = jest.fn(() => Promise.resolve(fakeNode));
const result = await richTextFromMarkdown(
'',
fallback,
);
expect(fallback).toHaveBeenCalledTimes(1);
expect(result).toEqual({
nodeType: BLOCKS.DOCUMENT,
data: {},
content: [
{
nodeType: 'image',
data: {},
},
],
});
});
});
describe.each<[string, string[], string[]?]>([
['*This is an italic text*', ['This is an italic text', 'italic']],
['__This a bold text__', ['This a bold text', 'bold']],
['`This is code`', ['This is code', 'code']],
[
'__This is bold and *this is an italic*__',
['This is bold and ', 'bold'],
['this is an italic', 'bold', 'italic'],
],
])(
'The markdown "%s" should be parsed to text with value "%s"',
(markdown, ...expectedTextWithMarks) => {
test(`${markdown}`, async () => {
const result = await richTextFromMarkdown(markdown);
expect(result).toEqual(
document(
{},
block(
BLOCKS.PARAGRAPH,
{},
...expectedTextWithMarks.map(([expectedText, ...expectedMarkTypes]) =>
text(expectedText, ...expectedMarkTypes.map(mark)),
),
),
),
);
});
},
);
describe('parses complex inline image markdown correctly', () => {
test('incoming markdown tree calls fallback twice', async () => {
const fakeNode = { nodeType: 'image', data: {} };
const fallback = jest.fn(() => Promise.resolve(fakeNode));
const result = await richTextFromMarkdown(
`
`,
fallback,
);
expect(fallback).toHaveBeenCalledTimes(2);
expect(result).toEqual({
nodeType: 'document',
data: {},
content: [
{
nodeType: 'image',
data: {},
},
block(
BLOCKS.PARAGRAPH,
{},
text(`
`),
),
{
nodeType: 'image',
data: {},
},
],
});
});
test('incoming markdown tree calls fallback twice', async () => {
const fakeNode = { nodeType: 'image', data: {} };
const fallback = jest.fn(() => Promise.resolve(fakeNode));
const result = await richTextFromMarkdown(
`some text  some more text`,
fallback,
);
expect(fallback).toHaveBeenCalledTimes(2);
expect(result).toEqual({
nodeType: 'document',
data: {},
content: [
block(BLOCKS.PARAGRAPH, {}, text('some text ')),
{
nodeType: 'image',
data: {},
},
{
nodeType: 'image',
data: {},
},
block(BLOCKS.PARAGRAPH, {}, text(' some more text')),
],
});
});
});
describe('links', () => {
test('should correctly convert a link', async () => {
const result = await richTextFromMarkdown('[This is a link](https://contentful.com)');
expect(result).toEqual(
document(
{},
block(
BLOCKS.PARAGRAPH,
{},
inline(
INLINES.HYPERLINK,
{
data: {
uri: 'https://contentful.com',
},
},
text('This is a link'),
),
),
),
);
});
test('should convert link wrapped in a mark', async () => {
const result = await richTextFromMarkdown(
'*This is a test [Contentful](https://www.contentful.com/). Text text*',
);
expect(result).toEqual(
document(
{},
block(
BLOCKS.PARAGRAPH,
{},
text('This is a test ', mark(MARKS.ITALIC)),
inline(
INLINES.HYPERLINK,
{
data: {
uri: 'https://www.contentful.com/',
},
},
text('Contentful', mark(MARKS.ITALIC)),
),
text('. Text text', mark(MARKS.ITALIC)),
),
),
);
});
});
================================================
FILE: packages/rich-text-from-markdown/src/__test__/real-world.md
================================================
<!-- prettier-ignore-start -->
# h1 Heading
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
## Paragraphs
This is a paragraph
with a new line.
This is a new paragraph.
This is a paragraph<br/>using br.
## Horizontal Rules
---
---
---
## Emphasis
**This is bold text**
**This is bold text**
_This is italic text_
_This is italic text_
~~Strikethrough is supported~~
## Blockquotes
> Blockquotes
## Lists
Unordered
- Create a list by starting a line with `+`, `-`, or `*`
- Sub-lists are made by indenting 2 spaces:
- Marker character change forces new list start:
- Ac tristique libero volutpat at
* Facilisis in pretium nisl aliquet
- Nulla volutpat aliquam velit
- Very easy!
- Here is a list item<br/>with a line break
Ordered
1. Lorem ipsum dolor sit amet
2. Consectetur adipiscing elit
3. Integer molestie lorem at massa
4. You can use sequential numbers...
5. ...or keep all the numbers as `1.`
Start numbering with offset:
57. foo
1. bar
## Code
Inline `code`
## Links
[link text](https://www.contentful.com)
[link with title](https://www.contentful.com/blog/ 'title text!')
## Tables
| Name | Country |
| -------------------------------------------- | ------- |
| Test 1 | Germany |
| Test 2 | USA |
| > Test 3 | USA |
| \* Test 4 | Germany |
| # Test 5 | Germany |
| <p>Test 6<br/>Test 7</p> | USA |
| <ul><li>Test 8</li></ul> | USA |
| <blockquote>Test 9</blockquote> | Germany |
| <div><p>Test 10</p> and <p>Test 11</p></div> | Germany |
| <img src="image.jpg" /> | Germany |
|  | Brazil |
| **[Test 12](https://example.com)** | USA |
## Tables with marks
| **Bold Header 1** | **Bold Header 2** |
| ----------------- | ----------------- |
| _Italic_ | `Code` |
## Tables without body
| abc | def |
| --- | --- |
## Table with empty cells
| | |
| ------ | ------ |
| Cell 1 | |
| | Cell 2 |
<!-- prettier-ignore-end -->
================================================
FILE: packages/rich-text-from-markdown/src/__test__/real-world.test.ts
================================================
import { BLOCKS, INLINES, MARKS } from '@contentful/rich-text-types';
import { readFileSync } from 'fs';
import path from 'path';
import { richTextFromMarkdown } from '..';
import { block, document, inline, mark, text } from './helpers';
describe('rich-text-from-markdown', () => {
it('should parse md with all formatting options', async () => {
const md = readFileSync(path.resolve(__dirname, './real-world.md'), 'utf8');
const result = await richTextFromMarkdown(md);
expect(result).toEqual(
document(
{},
block(BLOCKS.HEADING_1, {}, text('h1 Heading')),
block(BLOCKS.HEADING_2, {}, text('h2 Heading')),
block(BLOCKS.HEADING_3, {}, text('h3 Heading')),
block(BLOCKS.HEADING_4, {}, text('h4 Heading')),
block(BLOCKS.HEADING_5, {}, text('h5 Heading')),
block(BLOCKS.HEADING_6, {}, text('h6 Heading')),
// Paragraphs
block(BLOCKS.HEADING_2, {}, text('Paragraphs')),
block(
BLOCKS.PARAGRAPH,
{},
text(`This is a paragraph
with a new line.`),
),
block(BLOCKS.PARAGRAPH, {}, text('This is a new paragraph.')),
// TODO: <br /> test should be ideally the same as the new line one.
block(BLOCKS.PARAGRAPH, {}, text('This is a paragraph'), text('\n'), text('using br.')),
block(BLOCKS.HEADING_2, {}, text('Horizontal Rules')),
block(BLOCKS.HR),
block(BLOCKS.HR),
block(BLOCKS.HR),
block(BLOCKS.HEADING_2, {}, text('Emphasis')),
block(BLOCKS.PARAGRAPH, {}, text('This is bold text', mark(MARKS.BOLD))),
block(BLOCKS.PARAGRAPH, {}, text('This is bold text', mark(MARKS.BOLD))),
block(BLOCKS.PARAGRAPH, {}, text('This is italic text', mark(MARKS.ITALIC))),
block(BLOCKS.PARAGRAPH, {}, text('This is italic text', mark(MARKS.ITALIC))),
block(BLOCKS.PARAGRAPH, {}, text('Strikethrough is supported', mark(MARKS.STRIKETHROUGH))),
block(BLOCKS.HEADING_2, {}, text('Blockquotes')),
block(BLOCKS.QUOTE, {}, block(BLOCKS.PARAGRAPH, {}, text('Blockquotes'))),
block(BLOCKS.HEADING_2, {}, text('Lists')),
block(BLOCKS.PARAGRAPH, {}, text('Unordered')),
block(
BLOCKS.UL_LIST,
{},
block(
BLOCKS.LIST_ITEM,
{},
block(
BLOCKS.PARAGRAPH,
{},
text('Create a list by starting a line with '),
text('+', mark(MARKS.CODE)),
text(', '),
text('-', mark(MARKS.CODE)),
text(', or '),
text('*', mark(MARKS.CODE)),
),
),
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Sub-lists are made by indenting 2 spaces:')),
block(
BLOCKS.UL_LIST,
{},
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Marker character change forces new list start:')),
block(
BLOCKS.UL_LIST,
{},
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Ac tristique libero volutpat at')),
),
),
block(
BLOCKS.UL_LIST,
{},
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Facilisis in pretium nisl aliquet')),
),
),
block(
BLOCKS.UL_LIST,
{},
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Nulla volutpat aliquam velit')),
),
),
),
),
),
block(BLOCKS.LIST_ITEM, {}, block(BLOCKS.PARAGRAPH, {}, text('Very easy!'))),
block(
BLOCKS.LIST_ITEM,
{},
block(
BLOCKS.PARAGRAPH,
{},
text('Here is a list item'),
text('\n'),
text('with a line break'),
),
),
),
block(BLOCKS.PARAGRAPH, {}, text('Ordered')),
block(
BLOCKS.OL_LIST,
{},
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Lorem ipsum dolor sit amet')),
),
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Consectetur adipiscing elit')),
),
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('Integer molestie lorem at massa')),
),
block(
BLOCKS.LIST_ITEM,
{},
block(BLOCKS.PARAGRAPH, {}, text('You can use sequential numbers...')),
),
block(
BLOCKS.LIST_ITEM,
{},
block(
BLOCKS.PARAGRAPH,
{},
text('...or keep all the numbers as '),
text('1.', mark(MARKS.CODE)),
),
),
),
block(BLOCKS.PARAGRAPH, {}, text('Start numbering with offset:')),
block(
BLOCKS.OL_LIST,
{},
block(BLOCKS.LIST_ITEM, {}, block(BLOCKS.PARAGRAPH, {}, text('foo'))),
block(BLOCKS.LIST_ITEM, {}, block(BLOCKS.PARAGRAPH, {}, text('bar'))),
),
block(BLOCKS.HEADING_2, {}, text('Code')),
block(BLOCKS.PARAGRAPH, {}, text('Inline '), text('code', mark('code'))),
block(BLOCKS.HEADING_2, {}, text('Links')),
block(
BLOCKS.PARAGRAPH,
{},
inline(
INLINES.HYPERLINK,
{ data: { uri: 'https://www.contentful.com' } },
text('link text'),
),
),
block(
BLOCKS.PARAGRAPH,
{},
inline(
INLINES.HYPERLINK,
{ data: { uri: 'https://www.contentful.com/blog/' } },
text('link with title'),
),
),
// Tables
block(BLOCKS.HEADING_2, {}, text('Tables')),
block(
BLOCKS.TABLE,
{},
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Name'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Country'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Test 1'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Germany'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Test 2'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('USA'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('> Test 3'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('USA'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('* Test 4'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Germany'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('# Test 5'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Germany'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(
BLOCKS.TABLE_CELL,
{},
block(BLOCKS.PARAGRAPH, {}, text('Test 6'), text('\n'), text('Test 7')),
),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('USA'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Test 8'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('USA'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Test 9'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Germany'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(
BLOCKS.TABLE_CELL,
{},
block(BLOCKS.PARAGRAPH, {}, text('Test 10'), text(' and '), text('Test 11')),
),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Germany'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text(''))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Germany'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text(''))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Brazil'))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(
BLOCKS.TABLE_CELL,
{},
block(
BLOCKS.PARAGRAPH,
{},
inline(
INLINES.HYPERLINK,
{ data: { uri: 'https://example.com' } },
text('Test 12', mark(MARKS.BOLD)),
),
),
),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('USA'))),
),
),
// Tables with marks
block(BLOCKS.HEADING_2, {}, text('Tables with marks')),
block(
BLOCKS.TABLE,
{},
block(
BLOCKS.TABLE_ROW,
{},
block(
BLOCKS.TABLE_CELL,
{},
block(BLOCKS.PARAGRAPH, {}, text('Bold Header 1', mark(MARKS.BOLD))),
),
block(
BLOCKS.TABLE_CELL,
{},
block(BLOCKS.PARAGRAPH, {}, text('Bold Header 2', mark(MARKS.BOLD))),
),
),
block(
BLOCKS.TABLE_ROW,
{},
block(
BLOCKS.TABLE_CELL,
{},
block(BLOCKS.PARAGRAPH, {}, text('Italic', mark(MARKS.ITALIC))),
),
block(
BLOCKS.TABLE_CELL,
{},
block(BLOCKS.PARAGRAPH, {}, text('Code', mark(MARKS.CODE))),
),
),
),
// Tables without body
block(BLOCKS.HEADING_2, {}, text('Tables without body')),
block(
BLOCKS.TABLE,
{},
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('abc'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('def'))),
),
),
// Tables with empty cells
block(BLOCKS.HEADING_2, {}, text('Table with empty cells')),
block(
BLOCKS.TABLE,
{},
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text(''))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text(''))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Cell 1'))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text(''))),
),
block(
BLOCKS.TABLE_ROW,
{},
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text(''))),
block(BLOCKS.TABLE_CELL, {}, block(BLOCKS.PARAGRAPH, {}, text('Cell 2'))),
),
),
),
);
});
});
================================================
FILE: packages/rich-text-from-markdown/src/index.ts
================================================
import {
BLOCKS,
Block,
Document,
Hyperlink,
INLINES,
Inline,
Node,
Text,
TopLevelBlock,
} from '@contentful/rich-text-types';
import _ from 'lodash';
import gfm from 'remark-gfm';
import markdown from 'remark-parse';
import unified from 'unified';
import { MarkdownLinkNode, MarkdownNode, MarkdownTree } from './types';
const markdownNodeTypes = new Map<string, string>([
['paragraph', BLOCKS.PARAGRAPH],
['heading', 'heading'],
['text', 'text'],
['emphasis', 'text'],
['strong', 'text'],
['delete', 'text'],
['inlineCode', 'text'],
['link', INLINES.HYPERLINK],
['thematicBreak', BLOCKS.HR],
['blockquote', BLOCKS.QUOTE],
['list', 'list'],
['listItem', BLOCKS.LIST_ITEM],
['table', BLOCKS.TABLE],
['tableRow', BLOCKS.TABLE_ROW],
['tableCell', BLOCKS.TABLE_CELL],
]);
const nodeTypeFor = (node: MarkdownNode) => {
const nodeType = markdownNodeTypes.get(node.type);
switch (nodeType) {
case 'heading':
return `${nodeType}-${node.depth}`;
case 'list':
return `${node.ordered ? 'ordered' : 'unordered'}-list`;
default:
return nodeType;
}
};
const markTypes = new Map([
['emphasis', 'italic'],
['strong', 'bold'],
['inlineCode', 'code'],
['delete', 'strikethrough'],
]);
const markTypeFor = (node: MarkdownNode) => {
return markTypes.get(node.type);
};
const isLink = (node: MarkdownNode): node is MarkdownLinkNode => {
return node.type === 'link';
};
const nodeContainerTypes = new Map([
['delete', 'block'],
[BLOCKS.HEADING_1, 'block'],
[BLOCKS.HEADING_2, 'block'],
[BLOCKS.HEADING_3, 'block'],
[BLOCKS.HEADING_4, 'block'],
[BLOCKS.HEADING_5, 'block'],
[BLOCKS.HEADING_6, 'block'],
[BLOCKS.LIST_ITEM, 'block'],
[BLOCKS.UL_LIST, 'block'],
[BLOCKS.OL_LIST, 'block'],
[BLOCKS.QUOTE, 'block'],
[BLOCKS.HR, 'block'],
[BLOCKS.PARAGRAPH, 'block'],
[BLOCKS.TABLE, 'block'],
[BLOCKS.TABLE_CELL, 'block'],
[BLOCKS.TABLE_HEADER_CELL, 'block'],
[BLOCKS.TABLE_ROW, 'block'],
[INLINES.HYPERLINK, 'inline'],
['text', 'text'],
['emphasis', 'text'],
['strong', 'text'],
['inlineCode', 'text'],
['delete', 'text'],
]);
const isBlock = (nodeType: string) => {
return nodeContainerTypes.get(nodeType) === 'block';
};
const isText = (nodeType: string) => {
return nodeContainerTypes.get(nodeType) === 'text';
};
const isInline = (nodeType: string) => {
return nodeContainerTypes.get(nodeType) === 'inline';
};
const isTableCell = (nodeType: string) => {
return nodeType === BLOCKS.TABLE_CELL;
};
const buildHyperlink = async (
node: MarkdownLinkNode,
fallback: FallbackResolver,
appliedMarksTypes: string[],
): Promise<Hyperlink[]> => {
const content = (await mdToRichTextNodes(node.children, fallback, appliedMarksTypes)) as Text[];
const hyperlink: Hyperlink = {
nodeType: INLINES.HYPERLINK,
data: { uri: node.url },
content,
};
return [hyperlink];
};
const buildGenericBlockOrInline = async (
node: MarkdownNode,
fallback: FallbackResolver,
appliedMarksTypes: string[],
): Promise<Array<Block | Inline>> => {
const nodeType = nodeTypeFor(node);
const content = await mdToRichTextNodes(node.children, fallback, appliedMarksTypes);
return [
{
nodeType: nodeType,
content,
data: {},
} as Block | Inline,
];
};
const buildTableCell = async (
node: MarkdownNode,
fallback: FallbackResolver,
appliedMarksTypes: string[],
): Promise<Array<Block>> => {
const nodeChildren = await mdToRichTextNodes(node.children, fallback, appliedMarksTypes);
const content = nodeChildren.reduce((result, contentNode) => {
if (isText(contentNode.nodeType) || isInline(contentNode.nodeType)) {
const lastNode = result[result.length - 1];
if (lastNode && lastNode.nodeType === BLOCKS.PARAGRAPH) {
lastNode.content.push(contentNode);
} else {
result.push({ nodeType: BLOCKS.PARAGRAPH, data: {}, content: [contentNode] });
}
} else {
result.push(contentNode);
}
return result;
}, []);
// A table cell can't be empty
if (content.length === 0) {
content.push({
nodeType: BLOCKS.PARAGRAPH,
data: {},
content: [
{
nodeType: 'text',
data: {},
marks: [],
value: '',
} as Text,
],
});
}
/**
* We should only support texts inside table cells.
* Some markdowns might contain html inside tables such as <ul>, <blockquote>, etc
* but they are pretty much filtered out by markdownNodeTypes and nodeContainerTypes variables.
* so we ended up receiving only `text` nodes.
* We can't have table cells with text nodes directly, we must wrap text nodes inside paragraphs.
*/
return [
{
nodeType: BLOCKS.TABLE_CELL,
content,
data: {},
} as Block,
];
};
const buildText = async (
node: MarkdownNode,
fallback: FallbackResolver,
appliedMarksTypes: string[],
): Promise<Array<Inline | Text>> => {
const nodeType = nodeTypeFor(node);
const markType = markTypeFor(node);
const marks = Array.from(appliedMarksTypes);
if (markType) {
marks.push(markType);
}
if (node.type !== 'text' && node.children) {
return (await mdToRichTextNodes(node.children, fallback, marks)) as Array<Inline | Text>;
}
if (node.value) {
return [
{
nodeType: nodeType,
value: node.value,
marks: marks.map((type) => ({ type })),
data: {},
} as Text,
];
}
};
const buildFallbackNode = async (
node: MarkdownNode,
fallback: FallbackResolver,
): Promise<Node[]> => {
const fallbackResult = await fallback(node);
if (_.isArray(fallbackResult)) {
return fallbackResult;
}
return [fallbackResult];
};
async function mdToRichTextNode(
node: MarkdownNode,
fallback: FallbackResolver,
appliedMarksTypes: string[] = [],
): Promise<Node[]> {
// By default <br/> is parsed as html node, causing it to be stripped out.
// We need to convert it manually in order to support it
if (node.type === 'html' && /<br\s?\/?>/gi.test(node.value)) {
node.value = '\n';
node.type = 'text';
}
const nodeType = nodeTypeFor(node);
if (isLink(node)) {
return await buildHyperlink(node, fallback, appliedMarksTypes);
}
if (isTableCell(nodeType)) {
return await buildTableCell(node, fallback, appliedMarksTypes);
}
if (isBlock(nodeType) || isInline(nodeType)) {
return await buildGenericBlockOrInline(node, fallback, appliedMarksTypes);
}
if (isText(nodeType)) {
return await buildText(node, fallback, appliedMarksTypes);
}
return await buildFallbackNode(node, fallback);
}
async function mdToRichTextNodes(
nodes: MarkdownNode[],
fallback: FallbackResolver,
appliedMarksTypes: string[] = [],
): Promise<Node[]> {
if (!nodes) {
return Promise.resolve([]);
}
const rtNodes = await Promise.all(
nodes.map((node) => mdToRichTextNode(node, fallback, appliedMarksTypes)),
);
return _.flatten(rtNodes).filter(Boolean);
}
const astToRichTextDocument = async (
tree: MarkdownTree,
fallback: FallbackResolver,
): Promise<Document> => {
const content = await mdToRichTextNodes(tree.children, fallback);
return {
nodeType: BLOCKS.DOCUMENT,
data: {},
content: content as TopLevelBlock[],
};
};
function expandParagraphWithInlineImages(node: MarkdownNode): MarkdownNode[] {
if (node.type !== 'paragraph') {
return [node];
}
const imageNodeIndices = [];
for (let i = 0; i < node.children.length; i++) {
if (node.children[i].type === 'image') {
imageNodeIndices.push(i);
}
}
if (imageNodeIndices.length === 0) {
// If no images in children, return.
return [node];
}
const allNodes: MarkdownNode[] = [];
let lastIndex = -1;
for (let j = 0; j < imageNodeIndices.length; j++) {
const index = imageNodeIndices[j];
// before
if (index !== 0) {
const nodesBefore: MarkdownNode[] = node.children.slice(lastIndex + 1, index);
if (nodesBefore.length > 0) {
allNodes.push({
...node,
children: nodesBefore,
});
}
}
// image
const imageNode = node.children[index];
allNodes.push(imageNode);
// till end
let nodesAfter: MarkdownNode[] = [];
const rangeEnd =
j + 1 < imageNodeIndices.length ? imageNodeIndices[j + 1] : node.children.length;
if (index + 1 < rangeEnd && index === imageNodeIndices.slice(-1)[0]) {
nodesAfter = node.children.slice(index + 1, rangeEnd);
if (nodesAfter.length > 0) {
allNodes.push({
...node,
children: nodesAfter,
});
}
}
lastIndex = index;
}
return allNodes;
}
// Inline markdown images come in as nested within a MarkdownNode paragraph
// so we must hoist them out before transforming to rich text.
function prepareMdAST(ast: MarkdownTree): MarkdownNode {
function prepareASTNodeChildren(node: MarkdownNode): MarkdownNode {
if (!node.children) {
return node;
}
const children = _.flatMap(node.children, (n) => expandParagraphWithInlineImages(n)).map((n) =>
prepareASTNodeChildren(n),
);
return { ...node, children };
}
return prepareASTNodeChildren({
depth: '0',
type: 'root',
value: '',
ordered: true,
children: ast.children,
});
}
// COMPAT: can resolve with either Node or an array of Nodes for back compatibility.
export type FallbackResolver = (mdNode: MarkdownNode) => Promise<Node | Node[] | null>;
export async function richTextFromMarkdown(
md: string,
fallback: FallbackResolver = () => Promise.resolve(null),
): Promise<Document> {
const processor = unified().use(markdown).use(gfm);
const tree = processor.parse(md);
// @ts-expect-error children is missing in the return type of processor.parse
const ast = prepareMdAST(tree);
return await astToRichTextDocument(ast, fallback);
}
================================================
FILE: packages/rich-text-from-markdown/src/types/index.ts
================================================
export interface MarkdownNode extends MarkdownTree {
depth: string;
type: string;
ordered: boolean;
value: string;
}
export interface MarkdownTree {
children: MarkdownNode[];
}
export interface MarkdownLinkNode extends MarkdownNode {
url: string;
}
================================================
FILE: packages/rich-text-from-markdown/tsconfig.json
================================================
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"declarationDir": "dist/types",
"outDir": "dist/lib",
"strict": false,
"typeRoots": ["../../node_modules/@types", "node_modules/@types", "src/types"]
},
"include": ["src"]
}
================================================
FILE: packages/rich-text-html-renderer/CHANGELOG.md
================================================
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [17.2.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.2.1...@contentful/rich-text-html-renderer@17.2.2) (2026-04-09)
### Bug Fixes
- **rich-text-types:** improve esm compability [ZEND-7778] ([#1073](https://github.com/contentful/rich-text/issues/1073)) ([204aaec](https://github.com/contentful/rich-text/commit/204aaecc3893633c081986f44896e14272fa376a))
## [17.2.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.2.0...@contentful/rich-text-html-renderer@17.2.1) (2026-04-08)
### Bug Fixes
- **rich-text-html-renderer:** parse and render asset [] ([#854](https://github.com/contentful/rich-text/issues/854)) ([3ca028d](https://github.com/contentful/rich-text/commit/3ca028d828979a22cb208607371ffec8990d01b7)), closes [#853](https://github.com/contentful/rich-text/issues/853)
# [17.2.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.6...@contentful/rich-text-html-renderer@17.2.0) (2026-04-08)
### Features
- add esm support [ZEND-7778] ([#1069](https://github.com/contentful/rich-text/issues/1069)) ([8c320bd](https://github.com/contentful/rich-text/commit/8c320bde7fa313572bdad84b91a6fd12224afc3a)), closes [#1068](https://github.com/contentful/rich-text/issues/1068)
## [17.1.6](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.5...@contentful/rich-text-html-renderer@17.1.6) (2025-11-04)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [17.1.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.4...@contentful/rich-text-html-renderer@17.1.5) (2025-09-23)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [17.1.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.3...@contentful/rich-text-html-renderer@17.1.4) (2025-09-23)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [17.1.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.2...@contentful/rich-text-html-renderer@17.1.3) (2025-09-10)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [17.1.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.1...@contentful/rich-text-html-renderer@17.1.2) (2025-09-09)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [17.1.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.1.0...@contentful/rich-text-html-renderer@17.1.1) (2025-09-04)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [17.1.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.0.1...@contentful/rich-text-html-renderer@17.1.0) (2025-07-15)
### Features
- add an option to strip empty trailing paragraphs [TOL-3193] ([#892](https://github.com/contentful/rich-text/issues/892)) ([9beff0e](https://github.com/contentful/rich-text/commit/9beff0e4cba3e79dc68e6a0725e843c5d642eb87))
## [17.0.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@17.0.0...@contentful/rich-text-html-renderer@17.0.1) (2025-06-16)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [17.0.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.10...@contentful/rich-text-html-renderer@17.0.0) (2024-10-29)
### Features
- bring rich text validator [TOL-2426] ([#694](https://github.com/contentful/rich-text/issues/694)) ([30893a6](https://github.com/contentful/rich-text/commit/30893a68b171167502135b48258ba4b93c8375c7))
### BREAKING CHANGES
- removed getSchemaWithNodeType in favor of validateRichTextDocument
## [16.6.10](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.9...@contentful/rich-text-html-renderer@16.6.10) (2024-09-09)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.9](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.8...@contentful/rich-text-html-renderer@16.6.9) (2024-08-26)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.8](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.7...@contentful/rich-text-html-renderer@16.6.8) (2024-07-29)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.7](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.6...@contentful/rich-text-html-renderer@16.6.7) (2024-07-24)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.6](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.5...@contentful/rich-text-html-renderer@16.6.6) (2024-07-17)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.4...@contentful/rich-text-html-renderer@16.6.5) (2024-07-17)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.3...@contentful/rich-text-html-renderer@16.6.4) (2024-07-16)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.2...@contentful/rich-text-html-renderer@16.6.3) (2024-07-16)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.1...@contentful/rich-text-html-renderer@16.6.2) (2024-07-16)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.6.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.6.0...@contentful/rich-text-html-renderer@16.6.1) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [16.6.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.5.5...@contentful/rich-text-html-renderer@16.6.0) (2024-06-25)
### Features
- switch from tslint to eslint [TOL-2218][tol-2203] ([#594](https://github.com/contentful/rich-text/issues/594)) ([c077b5a](https://github.com/contentful/rich-text/commit/c077b5af58f94c8dc6af4715d4b82c2771d643c5))
## [16.5.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.5.4...@contentful/rich-text-html-renderer@16.5.5) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.5.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.5.3...@contentful/rich-text-html-renderer@16.5.4) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.5.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.5.2...@contentful/rich-text-html-renderer@16.5.3) (2024-06-25)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.5.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.5.1...@contentful/rich-text-html-renderer@16.5.2) (2024-05-28)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.5.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.5.0...@contentful/rich-text-html-renderer@16.5.1) (2024-05-27)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [16.5.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.4.0...@contentful/rich-text-html-renderer@16.5.0) (2024-05-24)
### Features
- add strikethrough support ([#562](https://github.com/contentful/rich-text/issues/562)) ([b87d0c3](https://github.com/contentful/rich-text/commit/b87d0c31bccb4012745c0479b2b5c92fc28c1e91))
# [16.4.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.3.5...@contentful/rich-text-html-renderer@16.4.0) (2024-05-22)
### Features
- upgrading rollup to latest version [TOL-2097] ([#559](https://github.com/contentful/rich-text/issues/559)) ([f14d197](https://github.com/contentful/rich-text/commit/f14d1974590d58f92bbf4cb56644095dba929ad9))
## [16.3.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.3.4...@contentful/rich-text-html-renderer@16.3.5) (2024-03-04)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.3.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.3.3...@contentful/rich-text-html-renderer@16.3.4) (2024-01-30)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.3.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.3.2...@contentful/rich-text-html-renderer@16.3.3) (2024-01-23)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.3.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.3.1...@contentful/rich-text-html-renderer@16.3.2) (2024-01-23)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.3.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.3.0...@contentful/rich-text-html-renderer@16.3.1) (2024-01-23)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [16.3.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.2.0...@contentful/rich-text-html-renderer@16.3.0) (2023-10-24)
### Features
- add default renderers for new resource nodes ([#504](https://github.com/contentful/rich-text/issues/504)) ([f748e6b](https://github.com/contentful/rich-text/commit/f748e6b0f0e22ce3809ca8881438b84b1baafb8f))
# [16.2.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.1.2...@contentful/rich-text-html-renderer@16.2.0) (2023-10-02)
### Features
- preserve formatting linebreak whitespace ([#497](https://github.com/contentful/rich-text/issues/497)) ([e62ab92](https://github.com/contentful/rich-text/commit/e62ab92f6320d970f921e751d1753cd290224224))
## [16.1.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.1.1...@contentful/rich-text-html-renderer@16.1.2) (2023-09-12)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.1.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.1.0...@contentful/rich-text-html-renderer@16.1.1) (2023-08-04)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [16.1.0](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.5...@contentful/rich-text-html-renderer@16.1.0) (2023-06-09)
### Features
- add default renderer for the node ([#472](https://github.com/contentful/rich-text/issues/472)) ([5a53caf](https://github.com/contentful/rich-text/commit/5a53cafc58aa8d009d2aa2d6cb4fa2d6cee6b19d))
## [16.0.5](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.4...@contentful/rich-text-html-renderer@16.0.5) (2023-05-26)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.0.4](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.3...@contentful/rich-text-html-renderer@16.0.4) (2023-05-04)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.0.3](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.2...@contentful/rich-text-html-renderer@16.0.3) (2023-03-14)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.0.2](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.1...@contentful/rich-text-html-renderer@16.0.2) (2022-12-01)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [16.0.1](https://github.com/contentful/rich-text/compare/@contentful/rich-text-html-renderer@16.0.0...@contentful/rich-text-html-renderer@16.0.1) (2022-12-01)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# 16.0.0 (2022-12-01)
## 15.15.1 (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# 15.15.0 (2022-11-29)
## 15.14.1 (2022-11-23)
# 15.14.0 (2022-11-14)
### Features
- add super/sub script types ([#391](https://github.com/contentful/rich-text/issues/391)) ([2562f66](https://github.com/contentful/rich-text/commit/2562f66278f0eff4eeeb367025d4b465773893d1))
## 15.13.2 (2022-09-07)
### Bug Fixes
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
- update Lerna, rollup in slatejs-adapter ([#366](https://github.com/contentful/rich-text/issues/366)) ([32448e3](https://github.com/contentful/rich-text/commit/32448e369ae2b76601dd81839e13c15432430d68))
## 15.13.1 (2022-05-10)
## 15.12.1 (2022-04-21)
# 15.12.0 (2022-03-25)
## 15.11.1 (2022-01-04)
# 15.11.0 (2021-12-27)
## 15.10.1 (2021-12-21)
# 15.10.0 (2021-12-15)
### Features
- support custom error transformer ([#296](https://github.com/contentful/rich-text/issues/296)) ([9449b87](https://github.com/contentful/rich-text/commit/9449b87fc063a00f11cfe7b2bc0fdb4d91251c69))
## 15.9.1 (2021-12-10)
### Bug Fixes
- **rich-text-types:** resolve generated JSON schemas ([#294](https://github.com/contentful/rich-text/issues/294)) ([1e5b4c4](https://github.com/contentful/rich-text/commit/1e5b4c474e1e27e97df177748c0c8df365a2ab71))
# 15.9.0 (2021-12-09)
# 15.8.0 (2021-11-11)
### Features
- add toContentfulDocument() and toSlatejsDocument() empty block node handling ([#287](https://github.com/contentful/rich-text/issues/287)) ([fa79626](https://github.com/contentful/rich-text/commit/fa79626e4020d9640a920ca5d0ccb654e89cfa90))
# 15.7.0 (2021-11-11)
## 15.6.2 (2021-11-05)
## 15.6.1 (2021-11-05)
# 15.6.0 (2021-11-04)
## 15.5.1 (2021-10-25)
# 15.5.0 (2021-10-25)
### Features
- add v1 node types constraints ([#279](https://github.com/contentful/rich-text/issues/279)) ([5026023](https://github.com/contentful/rich-text/commit/5026023610ec1439f24fd32df9977c2cd4c13e86))
# 15.4.0 (2021-09-16)
### Features
- **html+react:** render Table header as <th> ([#269](https://github.com/contentful/rich-text/issues/269)) ([0f82905](https://github.com/contentful/rich-text/commit/0f829059be6d91e042dfc71698009177ae4ab78d))
## 15.3.6 (2021-09-15)
## 15.3.5 (2021-09-13)
## 15.3.4 (2021-09-09)
### Bug Fixes
- replace import to fix typings for html-renderer ([#265](https://github.com/contentful/rich-text/issues/265)) ([40c2670](https://github.com/contentful/rich-text/commit/40c267069b18454517b0f4283a7e155cffa410b6))
## 15.3.3 (2021-09-07)
## 15.3.2 (2021-09-07)
## 15.3.1 (2021-09-07)
# 15.3.0 (2021-09-06)
# 15.2.0 (2021-08-16)
# 15.1.0 (2021-08-02)
### Bug Fixes
- 🐛 html encode default inlined CF entry/asset links ([41396eb](https://github.com/contentful/rich-text/commit/41396eb800f6d5c65c634c4394a6c60cf3425255))
- 🐛 prevent html injection via `data.uri` link rendering ([ecae89a](https://github.com/contentful/rich-text/commit/ecae89ad0d25175f342833ca989928670c24b8fd))
### Features
- 🎸 add RT html renderer tables support ([ce81375](https://github.com/contentful/rich-text/commit/ce8137577b269c62727dc64b7d47b4951597dbd6))
# 15.0.0 (2021-06-15)
## 14.1.2 (2020-11-02)
## 14.0.1 (2020-01-30)
# 14.0.0 (2020-01-28)
# 13.4.0 (2019-08-01)
# 13.1.0 (2019-03-04)
# 13.0.0 (2019-01-22)
## 12.2.1 (2019-01-22)
### Bug Fixes
- gracefully handle empty rich text documents ([14870de](https://github.com/contentful/rich-text/commit/14870ded471f69cee84a60739bee06873ed53af9))
## 12.1.2 (2018-12-14)
### Features
- add html escaping ([4b55331](https://github.com/contentful/rich-text/commit/4b55331e86bc62787420f8081228293f1a22e1b7))
# 12.1.0 (2018-12-12)
## 12.0.3 (2018-12-05)
### Bug Fixes
- **readme:** mark types in readme examples ([d997b56](https://github.com/contentful/rich-text/commit/d997b56f2b8c32b2e5b478ab5444757203e2c703))
## 12.0.2 (2018-12-04)
### Bug Fixes
- 🐛 update path to typings ([ce5544f](https://github.com/contentful/rich-text/commit/ce5544f58712dc6a18aadda523d0c0357a66c8a5))
## 12.0.1 (2018-12-04)
# 12.0.0 (2018-11-29)
# 11.0.0 (2018-11-27)
# 10.3.0 (2018-11-26)
# 10.2.0 (2018-11-19)
### Features
- 🎸 Add rich-text-references ([363b4e5](https://github.com/contentful/rich-text/commit/363b4e509e94af0932fd7cece8e56beafe8d67d2))
# 10.1.0 (2018-11-16)
## 10.0.1 (2018-11-08)
# 10.0.0 (2018-11-02)
### Features
- 🎸 removes nodeClass from Node interface ([09b8162](https://github.com/contentful/rich-text/commit/09b8162bcba65bc13afa14b2b5ff046c9fed7b3b))
### BREAKING CHANGES
- Removes accidentally added nodeClass
## 9.0.2 (2018-10-31)
# 9.0.0 (2018-10-30)
### Features
- 🎸 Explicitly declare nodeClass and nodeType in core types ([0749c61](https://github.com/contentful/rich-text/commit/0749c6199bb2681509608539c76bd8149cade564))
### BREAKING CHANGES
- Potentially breaks TypeScript libraries pulling this in as a dependency
if they are not explicitly stating nodeClass and nodeType.
## 8.0.3 (2018-10-30)
## 8.0.2 (2018-10-29)
## 8.0.1 (2018-10-26)
### Bug Fixes
- 🐛 Revert mock hypenation commits ([bde9432](https://github.com/contentful/rich-text/commit/bde94323fcc02bf5ab3feeef46a9d8fc8b08d59b))
- sync HTML renderer ([769bd95](https://github.com/contentful/rich-text/commit/769bd95add1aecad0e11fab377f99c5cdad99072))
### Features
- 🎸 take all packages out of "demo mode" ([815f18b](https://github.com/contentful/rich-text/commit/815f18be6a914e7e4782790ee46053689712494b))
### BREAKING CHANGES
- renames all packages
# 6.0.0 (2018-10-24)
## [15.15.1](https://github.com/contentful/rich-text/compare/v15.15.0...v15.15.1) (2022-11-30)
### Bug Fixes
- **release:** switch to yarn ([#420](https://github.com/contentful/rich-text/issues/420)) ([0e53501](https://github.com/contentful/rich-text/commit/0e53501eb94b3d1c76ac88ca30943d2675e536c8))
# [15.15.0](https://github.com/contentful/rich-text/compare/v15.14.1...v15.15.0) (2022-11-29)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [15.14.1](https://github.com/contentful/rich-text/compare/v15.14.0...v15.14.1) (2022-11-23)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [15.14.0](https://github.com/contentful/rich-text/compare/v15.13.2...v15.14.0) (2022-11-14)
### Features
- add super/sub script types ([#391](https://github.com/contentful/rich-text/issues/391)) ([2562f66](https://github.com/contentful/rich-text/commit/2562f66278f0eff4eeeb367025d4b465773893d1))
## [15.13.2](https://github.com/contentful/rich-text/compare/v15.13.1...v15.13.2) (2022-09-07)
### Bug Fixes
- add prettier write command ([#345](https://github.com/contentful/rich-text/issues/345)) ([0edad4c](https://github.com/contentful/rich-text/commit/0edad4c3176cea85d56a55fc5f4072419d730c8a))
- update Lerna, rollup in slatejs-adapter ([#366](https://github.com/contentful/rich-text/issues/366)) ([32448e3](https://github.com/contentful/rich-text/commit/32448e369ae2b76601dd81839e13c15432430d68))
## [15.13.1](https://github.com/contentful/rich-text/compare/v15.13.0...v15.13.1) (2022-05-10)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [15.12.1](https://github.com/contentful/rich-text/compare/v15.12.0...v15.12.1) (2022-04-21)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [15.12.0](https://github.com/contentful/rich-text/compare/v15.11.2...v15.12.0) (2022-03-25)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [15.11.1](https://github.com/contentful/rich-text/compare/v15.11.0...v15.11.1) (2022-01-04)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [15.11.0](https://github.com/contentful/rich-text/compare/v15.10.1...v15.11.0) (2021-12-27)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [15.10.1](https://github.com/contentful/rich-text/compare/v15.10.0...v15.10.1) (2021-12-21)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [15.10.0](https://github.com/contentful/rich-text/compare/v15.9.1...v15.10.0) (2021-12-15)
### Features
- support custom error transformer ([#296](https://github.com/contentful/rich-text/issues/296)) ([9449b87](https://github.com/contentful/rich-text/commit/9449b87fc063a00f11cfe7b2bc0fdb4d91251c69))
## [15.9.1](https://github.com/contentful/rich-text/compare/v15.9.0...v15.9.1) (2021-12-10)
### Bug Fixes
- **rich-text-types:** resolve generated JSON schemas ([#294](https://github.com/contentful/rich-text/issues/294)) ([1e5b4c4](https://github.com/contentful/rich-text/commit/1e5b4c474e1e27e97df177748c0c8df365a2ab71))
# [15.9.0](https://github.com/contentful/rich-text/compare/v15.8.0...v15.9.0) (2021-12-09)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
# [15.8.0](https://github.com/contentful/rich-text/compare/v15.7.0...v15.8.0) (2021-11-11)
### Features
- add toContentfulDocument() and toSlatejsDocument() empty block node handling ([#287](https://github.com/contentful/rich-text/issues/287)) ([fa79626](https://github.com/contentful/rich-text/commit/fa79626e4020d9640a920ca5d0ccb654e89cfa90))
# [15.7.0](https://github.com/contentful/rich-text/compare/v15.6.2...v15.7.0) (2021-11-11)
**Note:** Version bump only for package @contentful/rich-text-html-renderer
## [15.6.2](https://github.com/contentful/ri
gitextract_d499cr83/ ├── .circleci/ │ └── config.yml ├── .contentful/ │ ├── compressed-size.yml │ └── vault-secrets.yaml ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github/ │ ├── dependabot.yml │ ├── semantic.yml │ └── workflows/ │ ├── auto-approve.yml │ └── codeql.yml ├── .gitignore ├── .husky/ │ └── pre-commit ├── .npmrc ├── .nvmrc ├── .prettierignore ├── .swcrc ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── baseJestConfig.js ├── catalog-info.yaml ├── commitlint.config.js ├── lerna.json ├── nx.json ├── package.json ├── packages/ │ ├── contentful-slatejs-adapter/ │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── rollup.config.ts │ │ ├── src/ │ │ │ ├── __test__/ │ │ │ │ ├── contentful-helpers.ts │ │ │ │ └── contentful-to-slatejs-adapter.test.ts │ │ │ ├── contentful-to-slatejs-adapter.ts │ │ │ ├── helpers.ts │ │ │ ├── index.ts │ │ │ ├── schema.ts │ │ │ ├── slatejs-to-contentful-adapter.ts │ │ │ └── types/ │ │ │ ├── index.ts │ │ │ └── slate.ts │ │ └── tsconfig.json │ ├── rich-text-from-markdown/ │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── __test__/ │ │ │ │ ├── helpers.ts │ │ │ │ ├── index.test.ts │ │ │ │ ├── real-world.md │ │ │ │ └── real-world.test.ts │ │ │ ├── index.ts │ │ │ └── types/ │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── rich-text-html-renderer/ │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── __test__/ │ │ │ │ ├── documents/ │ │ │ │ │ ├── embedded-entry.ts │ │ │ │ │ ├── embedded-resource.ts │ │ │ │ │ ├── heading.ts │ │ │ │ │ ├── hr.ts │ │ │ │ │ ├── hyperlink.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── inline-entity.ts │ │ │ │ │ ├── invalid-marks.ts │ │ │ │ │ ├── invalid-type.ts │ │ │ │ │ ├── mark.ts │ │ │ │ │ ├── ol.ts │ │ │ │ │ ├── paragraph.ts │ │ │ │ │ ├── quote.ts │ │ │ │ │ ├── table-header.ts │ │ │ │ │ ├── table.ts │ │ │ │ │ └── ul.ts │ │ │ │ └── index.test.ts │ │ │ ├── escapeHtml.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── rich-text-links/ │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── __test__/ │ │ │ │ └── index.test.ts │ │ │ ├── index.ts │ │ │ └── types/ │ │ │ └── utils.ts │ │ └── tsconfig.json │ ├── rich-text-plain-text-renderer/ │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── bin/ │ │ │ ├── benchmark/ │ │ │ │ └── get-rich-text-entity-links.ts │ │ │ └── tsconfig.json │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── __test__/ │ │ │ │ └── index.test.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── rich-text-react-renderer/ │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── jest.config.js │ │ ├── package.json │ │ ├── rollup.config.js │ │ ├── src/ │ │ │ ├── __test__/ │ │ │ │ ├── __snapshots__/ │ │ │ │ │ └── index.test.tsx.snap │ │ │ │ ├── components/ │ │ │ │ │ ├── Document.tsx │ │ │ │ │ ├── Paragraph.tsx │ │ │ │ │ └── Strong.tsx │ │ │ │ ├── documents/ │ │ │ │ │ ├── embedded-entry.ts │ │ │ │ │ ├── embedded-resource.ts │ │ │ │ │ ├── heading.ts │ │ │ │ │ ├── hr.ts │ │ │ │ │ ├── hyperlink.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── inline-entity.ts │ │ │ │ │ ├── invalid-marks.ts │ │ │ │ │ ├── invalid-type.ts │ │ │ │ │ ├── mark.ts │ │ │ │ │ ├── multi-mark.ts │ │ │ │ │ ├── ol.ts │ │ │ │ │ ├── paragraph.ts │ │ │ │ │ ├── quote.ts │ │ │ │ │ ├── table-header.ts │ │ │ │ │ ├── table.ts │ │ │ │ │ └── ul.ts │ │ │ │ └── index.test.tsx │ │ │ ├── index.tsx │ │ │ └── util/ │ │ │ ├── appendKeyToValidElement.ts │ │ │ └── nodeListToReactComponents.tsx │ │ └── tsconfig.json │ └── rich-text-types/ │ ├── CHANGELOG.md │ ├── README.md │ ├── __mocks__/ │ │ └── @lingui/ │ │ └── core/ │ │ └── macro.js │ ├── __test__/ │ │ ├── helpers.test.ts │ │ ├── schemaConstraints.test.ts │ │ └── validation.test.ts │ ├── jest.config.js │ ├── package.json │ ├── scripts/ │ │ └── fix-esm-import-extensions.mjs │ ├── src/ │ │ ├── blocks.ts │ │ ├── emptyDocument.ts │ │ ├── helpers.ts │ │ ├── index.ts │ │ ├── inlines.ts │ │ ├── marks.ts │ │ ├── nodeTypes.ts │ │ ├── schemaConstraints.ts │ │ ├── types.ts │ │ └── validator/ │ │ ├── assert.ts │ │ ├── errors.ts │ │ ├── index.ts │ │ ├── node.ts │ │ ├── path.ts │ │ ├── text.ts │ │ └── types.ts │ └── tsconfig.json ├── pnpm-workspace.yaml ├── renovate.json ├── rollup.config.js └── tsconfig.json
SYMBOL INDEX (180 symbols across 40 files)
FILE: baseJestConfig.js
function getConfig (line 1) | function getConfig(packageName) {
FILE: packages/contentful-slatejs-adapter/src/__test__/contentful-helpers.ts
type NodeProps (line 13) | interface NodeProps {
function document (line 18) | function document(...content: TopLevelBlock[]): Document {
function block (line 31) | function block(nodeType: BLOCKS, ...content: Array<Block | Inline | Text...
function inline (line 39) | function inline(nodeType: INLINES, ...content: Array<Inline | Text>): In...
function text (line 47) | function text(value: string, ...marks: Mark[]): Text {
function mark (line 56) | function mark(type: string): Mark {
FILE: packages/contentful-slatejs-adapter/src/contentful-to-slatejs-adapter.ts
type ToSlatejsDocumentProperties (line 14) | interface ToSlatejsDocumentProperties {
function toSlatejsDocument (line 19) | function toSlatejsDocument({
function convertNode (line 30) | function convertNode(node: ContentfulNode, schema: Schema): SlateNode {
function convertElementNode (line 43) | function convertElementNode(
function convertTextNode (line 60) | function convertTextNode(node: Contentful.Text): SlateText {
function convertTextMarks (line 68) | function convertTextMarks(node: Contentful.Text): SlateMarks {
FILE: packages/contentful-slatejs-adapter/src/schema.ts
type SchemaJSON (line 19) | interface SchemaJSON {
type Schema (line 24) | interface Schema extends SchemaJSON {
type SchemaValue (line 29) | interface SchemaValue {
function fromJSON (line 41) | function fromJSON(schema: SchemaJSON = defaultSchema): Schema {
FILE: packages/contentful-slatejs-adapter/src/slatejs-to-contentful-adapter.ts
type ToContentfulDocumentProperties (line 14) | interface ToContentfulDocumentProperties {
function toContentfulDocument (line 19) | function toContentfulDocument({
function convertNode (line 36) | function convertNode(node: SlateNode, schema: Schema): ContentfulNode[] {
function convertText (line 60) | function convertText(node: SlateText): Contentful.Text {
function getMarkList (line 70) | function getMarkList(marks: SlateMarks): Contentful.Mark[] {
function isSlateElement (line 78) | function isSlateElement(node: SlateNode): node is SlateElement {
FILE: packages/contentful-slatejs-adapter/src/types/index.ts
type SlateMarks (line 3) | type SlateMarks = {
type SlateText (line 20) | type SlateText = SlateMarks & {
type SlateElement (line 25) | type SlateElement = {
type ContentfulElementNode (line 32) | type ContentfulElementNode = Contentful.Block | Contentful.Inline;
type ContentfulNode (line 33) | type ContentfulNode = ContentfulElementNode | Contentful.Text;
type SlateNode (line 34) | type SlateNode = SlateElement | SlateText;
FILE: packages/contentful-slatejs-adapter/src/types/slate.ts
type NodeObject (line 5) | type NodeObject = 'document' | 'block' | 'inline' | 'text';
type Node (line 6) | interface Node {
type Document (line 13) | interface Document extends Node {
type Block (line 18) | interface Block extends Node {
type Inline (line 24) | interface Inline extends Node {
type Text (line 29) | interface Text extends Node {
type Mark (line 34) | interface Mark {
type TextLeaf (line 40) | interface TextLeaf {
FILE: packages/rich-text-from-markdown/src/__test__/helpers.ts
type NodeProps (line 10) | interface NodeProps {
function document (line 16) | function document(props: NodeProps = defaultProps, ...content: TopLevelB...
function block (line 25) | function block<T extends Block>(
function inline (line 38) | function inline(
function text (line 51) | function text(value: string, ...marks: Mark[]): Text {
function mark (line 60) | function mark(type: string): Mark {
FILE: packages/rich-text-from-markdown/src/index.ts
function mdToRichTextNode (line 233) | async function mdToRichTextNode(
function mdToRichTextNodes (line 266) | async function mdToRichTextNodes(
function expandParagraphWithInlineImages (line 293) | function expandParagraphWithInlineImages(node: MarkdownNode): MarkdownNo...
function prepareMdAST (line 349) | function prepareMdAST(ast: MarkdownTree): MarkdownNode {
type FallbackResolver (line 372) | type FallbackResolver = (mdNode: MarkdownNode) => Promise<Node | Node[] ...
function richTextFromMarkdown (line 374) | async function richTextFromMarkdown(
FILE: packages/rich-text-from-markdown/src/types/index.ts
type MarkdownNode (line 1) | interface MarkdownNode extends MarkdownTree {
type MarkdownTree (line 8) | interface MarkdownTree {
type MarkdownLinkNode (line 12) | interface MarkdownLinkNode extends MarkdownNode {
FILE: packages/rich-text-html-renderer/src/__test__/documents/inline-entity.ts
function inlineEntity (line 3) | function inlineEntity(entry: Record<string, any>, inlineType: INLINES) {
FILE: packages/rich-text-html-renderer/src/escapeHtml.ts
function escapeHtml (line 11) | function escapeHtml(input: string): string {
FILE: packages/rich-text-html-renderer/src/index.ts
type CommonNode (line 74) | type CommonNode = Text | Block | Inline;
type Next (line 76) | interface Next {
type NodeRenderer (line 80) | interface NodeRenderer {
type RenderNode (line 84) | interface RenderNode {
type RenderMark (line 88) | interface RenderMark {
type Options (line 92) | interface Options {
function documentToHtmlString (line 114) | function documentToHtmlString(
function nodeListToHtmlString (line 141) | function nodeListToHtmlString(
function nodeToHtmlString (line 150) | function nodeToHtmlString(
FILE: packages/rich-text-links/src/__test__/index.test.ts
function makeResourceLink (line 10) | function makeResourceLink(spaceId: string, entryId: string) {
FILE: packages/rich-text-links/src/index.ts
type EntityLinks (line 15) | type EntityLinks = { [type in EntityType]: EntityLink[] };
type EntityLinkMaps (line 16) | type EntityLinkMaps = { [type in EntityType]: Map<string, EntityLink> };
type EntityType (line 17) | type EntityType = 'Entry' | 'Asset';
type EntityLink (line 18) | type EntityLink = SysObject['sys'];
type SysObject (line 19) | type SysObject = Link<EntityType>;
type EntityLinkNodeData (line 20) | type EntityLinkNodeData = {
type AcceptedResourceLinkTypes (line 25) | type AcceptedResourceLinkTypes =
function getRichTextResourceLinks (line 33) | function getRichTextResourceLinks(
function getAllRichTextResourceLinks (line 44) | function getAllRichTextResourceLinks(
function getValidResourceLinks (line 59) | function getValidResourceLinks(
function getRichTextEntityLinks (line 78) | function getRichTextEntityLinks(
function isContentNode (line 110) | function isContentNode(node: Node): node is Inline | Block {
function visitNodes (line 114) | function visitNodes(startNode: Maybe<Node>, onVisit: (node: Node) => voi...
function isLinkObject (line 132) | function isLinkObject(data: NodeData): data is EntityLinkNodeData {
function iteratorToArray (line 163) | function iteratorToArray<T>(iterator: IterableIterator<T>): T[] {
FILE: packages/rich-text-links/src/types/utils.ts
type Maybe (line 1) | type Maybe<T> = T | null | undefined;
FILE: packages/rich-text-plain-text-renderer/bin/benchmark/get-rich-text-entity-links.ts
function times (line 9) | function times<N extends Node>(n: number, node: N): N[] {
FILE: packages/rich-text-plain-text-renderer/src/index.ts
type Options (line 3) | interface Options {
function documentToPlainTextString (line 16) | function documentToPlainTextString(
FILE: packages/rich-text-react-renderer/src/__test__/components/Document.tsx
type DocumentProps (line 3) | type DocumentProps = {
FILE: packages/rich-text-react-renderer/src/__test__/components/Paragraph.tsx
type ParagraphProps (line 3) | type ParagraphProps = {
FILE: packages/rich-text-react-renderer/src/__test__/components/Strong.tsx
type StrongProps (line 3) | type StrongProps = {
FILE: packages/rich-text-react-renderer/src/__test__/documents/inline-entity.ts
function inlineEntity (line 3) | function inlineEntity(entry: Record<string, any>, inlineType: INLINES) {
FILE: packages/rich-text-react-renderer/src/index.tsx
function defaultInline (line 60) | function defaultInline(type: string, node: Inline): ReactNode {
function defaultInlineResource (line 68) | function defaultInlineResource(type: string, node: Inline) {
type CommonNode (line 76) | type CommonNode = Text | Block | Inline;
type NodeRenderer (line 78) | interface NodeRenderer {
type RenderNode (line 82) | interface RenderNode {
type RenderMark (line 86) | interface RenderMark {
type RenderText (line 90) | interface RenderText {
type Options (line 94) | interface Options {
function documentToReactComponents (line 120) | function documentToReactComponents(
FILE: packages/rich-text-react-renderer/src/util/appendKeyToValidElement.ts
function appendKeyToValidElement (line 3) | function appendKeyToValidElement(element: ReactNode, key: number): React...
FILE: packages/rich-text-react-renderer/src/util/nodeListToReactComponents.tsx
function nodeListToReactComponents (line 9) | function nodeListToReactComponents(nodes: CommonNode[], options: Options...
function nodeToReactComponent (line 15) | function nodeToReactComponent(node: CommonNode, options: Options): React...
FILE: packages/rich-text-types/scripts/fix-esm-import-extensions.mjs
constant REWRITES (line 18) | const REWRITES = [
function rewrite (line 27) | function rewrite(code) {
FILE: packages/rich-text-types/src/blocks.ts
type BLOCKS (line 4) | enum BLOCKS {
FILE: packages/rich-text-types/src/emptyDocument.ts
constant EMPTY_DOCUMENT (line 8) | const EMPTY_DOCUMENT: Document = {
FILE: packages/rich-text-types/src/helpers.ts
function hasValue (line 9) | function hasValue(obj: Record<string, unknown>, value: unknown) {
function isInline (line 22) | function isInline(node: Node): node is Inline {
function isBlock (line 29) | function isBlock(node: Node): node is Block {
function isText (line 36) | function isText(node: Node): node is Text {
function isEmptyParagraph (line 43) | function isEmptyParagraph(node: Block): boolean {
function isValidDocument (line 56) | function isValidDocument(document: unknown): document is CDocument {
constant MIN_NODES_FOR_STRIPPING (line 65) | const MIN_NODES_FOR_STRIPPING = 2;
function stripEmptyTrailingParagraphFromDocument (line 74) | function stripEmptyTrailingParagraphFromDocument(document: CDocument): C...
FILE: packages/rich-text-types/src/inlines.ts
type INLINES (line 8) | enum INLINES {
FILE: packages/rich-text-types/src/marks.ts
type MARKS (line 4) | enum MARKS {
FILE: packages/rich-text-types/src/nodeTypes.ts
type EmptyNodeData (line 6) | type EmptyNodeData = {};
type Heading1 (line 10) | interface Heading1 extends Block {
type Heading2 (line 16) | interface Heading2 extends Block {
type Heading3 (line 22) | interface Heading3 extends Block {
type Heading4 (line 28) | interface Heading4 extends Block {
type Heading5 (line 34) | interface Heading5 extends Block {
type Heading6 (line 40) | interface Heading6 extends Block {
type Paragraph (line 47) | interface Paragraph extends Block {
type Quote (line 54) | interface Quote extends Block {
type Hr (line 60) | interface Hr extends Block {
type OrderedList (line 71) | interface OrderedList extends Block {
type UnorderedList (line 77) | interface UnorderedList extends Block {
type ListItem (line 83) | interface ListItem extends Block {
type Link (line 90) | interface Link<T extends string = string> {
type ResourceLink (line 98) | interface ResourceLink {
type EntryLinkBlock (line 106) | interface EntryLinkBlock extends Block {
type AssetLinkBlock (line 118) | interface AssetLinkBlock extends Block {
type ResourceLinkBlock (line 130) | interface ResourceLinkBlock extends Block {
type EntryLinkInline (line 144) | interface EntryLinkInline extends Inline {
type ResourceLinkInline (line 156) | interface ResourceLinkInline extends Inline {
type Hyperlink (line 168) | interface Hyperlink extends Inline {
type AssetHyperlink (line 176) | interface AssetHyperlink extends Inline {
type EntryHyperlink (line 184) | interface EntryHyperlink extends Inline {
type ResourceHyperlink (line 192) | interface ResourceHyperlink extends Inline {
type TableCell (line 200) | interface TableCell extends Block {
type TableHeaderCell (line 213) | interface TableHeaderCell extends TableCell {
type TableRow (line 219) | interface TableRow extends Block {
type Table (line 229) | interface Table extends Block {
FILE: packages/rich-text-types/src/schemaConstraints.ts
type TopLevelBlockEnum (line 5) | type TopLevelBlockEnum =
constant TOP_LEVEL_BLOCKS (line 26) | const TOP_LEVEL_BLOCKS: TopLevelBlockEnum[] = [
type ListItemBlockEnum (line 44) | type ListItemBlockEnum =
constant LIST_ITEM_BLOCKS (line 63) | const LIST_ITEM_BLOCKS: TopLevelBlockEnum[] = [
constant TABLE_BLOCKS (line 80) | const TABLE_BLOCKS = [
constant VOID_BLOCKS (line 90) | const VOID_BLOCKS = [
constant CONTAINERS (line 102) | const CONTAINERS = {
constant HEADINGS (line 116) | const HEADINGS = [
constant TEXT_CONTAINERS (line 128) | const TEXT_CONTAINERS = [BLOCKS.PARAGRAPH, ...HEADINGS];
constant V1_NODE_TYPES (line 133) | const V1_NODE_TYPES = [
constant V1_MARKS (line 159) | const V1_MARKS = [MARKS.BOLD, MARKS.CODE, MARKS.ITALIC, MARKS.UNDERLINE];
FILE: packages/rich-text-types/src/types.ts
type NodeData (line 8) | type NodeData = Record<string, any>;
type Node (line 9) | interface Node {
type Block (line 15) | interface Block extends Node {
type Inline (line 20) | interface Inline extends Node {
type TopLevelBlock (line 25) | interface TopLevelBlock extends Block {
type Document (line 29) | interface Document extends Node {
type Text (line 34) | interface Text extends Node {
type Mark (line 40) | interface Mark {
type ListItemBlock (line 44) | interface ListItemBlock extends Block {
FILE: packages/rich-text-types/src/validator/assert.ts
class ObjectAssertion (line 12) | class ObjectAssertion {
method constructor (line 15) | constructor(
method errors (line 24) | get errors(): ValidationError[] {
FILE: packages/rich-text-types/src/validator/index.ts
function validateNode (line 75) | function validateNode(node: Node | Text, path: Path): ValidationError[] {
FILE: packages/rich-text-types/src/validator/node.ts
type Node (line 15) | type Node = Document | Block | Inline;
type GetContentRule (line 17) | type GetContentRule<T extends Node> =
type ValidateData (line 27) | type ValidateData<T extends Node> = (data: T['data'], path: Path) => Val...
constant VOID_CONTENT (line 29) | const VOID_CONTENT: GetContentRule<Node> = [];
class NodeAssertion (line 31) | class NodeAssertion<T extends Node = Node> {
method constructor (line 32) | constructor(
method assert (line 37) | assert(node: T, path: Path): ValidationError[] {
class EntityLinkAssertion (line 91) | class EntityLinkAssertion<
method constructor (line 102) | constructor(
class HyperLinkAssertion (line 138) | class HyperLinkAssertion<T extends Hyperlink> extends NodeAssertion<T> {
method constructor (line 139) | constructor() {
FILE: packages/rich-text-types/src/validator/path.ts
class Path (line 1) | class Path {
method constructor (line 2) | constructor(private readonly path: (string | number)[] = []) {}
FILE: packages/rich-text-types/src/validator/text.ts
function assertText (line 6) | function assertText(text: Text, path: Path): ValidationError[] {
FILE: packages/rich-text-types/src/validator/types.ts
type ValidationError (line 1) | type ValidationError = {
Condensed preview — 160 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (564K chars).
[
{
"path": ".circleci/config.yml",
"chars": 3157,
"preview": "version: 2.1\n\norbs:\n frontend-tools: contentful/frontend-tools@2\n vault: contentful/vault@1.30.0\n nx: nrwl/nx@1.6.2\n\n"
},
{
"path": ".contentful/compressed-size.yml",
"chars": 193,
"preview": "version: 1\n\ncompressed-size:\n compression: 'gzip'\n pattern: './packages/*/{dist,build}/**/*.{js,css}'\n strip-hash: \"\\"
},
{
"path": ".contentful/vault-secrets.yaml",
"chars": 192,
"preview": "version: 1\nservices:\n github-action:\n policies:\n - dependabot\n circleci:\n policies:\n - github-comment\n"
},
{
"path": ".editorconfig",
"chars": 211,
"preview": "#root = true\n\n[*]\nindent_style = space\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_new"
},
{
"path": ".eslintignore",
"chars": 52,
"preview": "node_modules/\n.coverage/\n.cache/\ndist/\n.eslintrc.js\n"
},
{
"path": ".eslintrc.js",
"chars": 1045,
"preview": "module.exports = {\n env: {\n browser: true,\n es2021: true,\n },\n extends: [\n 'eslint:recommended',\n 'plugin"
},
{
"path": ".github/dependabot.yml",
"chars": 763,
"preview": "version: 2\n\nregistries:\n npm-registry-registry-npmjs-org:\n type: npm-registry\n url: https://registry.npmjs.org\n "
},
{
"path": ".github/semantic.yml",
"chars": 191,
"preview": "titleAndCommits: true\nanyCommit: true\nallowMergeCommits: false\ntypes:\n - feat\n - fix\n - improvement\n - docs\n - styl"
},
{
"path": ".github/workflows/auto-approve.yml",
"chars": 360,
"preview": "name: 'dependabot approve-and-request-merge'\non: pull_request_target\n\njobs:\n worker:\n permissions:\n contents: w"
},
{
"path": ".github/workflows/codeql.yml",
"chars": 662,
"preview": "---\nname: \"CodeQL Scan for GitHub Actions Workflow\"\n\non:\n push:\n branches: [master]\n paths: [\".github/workflows/*"
},
{
"path": ".gitignore",
"chars": 650,
"preview": "# Logs\n**/logs\n**/*.log\n**/npm-debug.log*\n**/yarn-debug.log*\n**/yarn-error.log*\n\n# Coverage\n**/coverage\n\n# node-waf conf"
},
{
"path": ".husky/pre-commit",
"chars": 16,
"preview": "npx lint-staged\n"
},
{
"path": ".npmrc",
"chars": 78,
"preview": "registry=https://registry.npmjs.org\nignore-scripts=true\nshamefully-hoist=true\n"
},
{
"path": ".nvmrc",
"chars": 4,
"preview": "v24\n"
},
{
"path": ".prettierignore",
"chars": 36,
"preview": "**/node_modules\n**/dist\n**/coverage\n"
},
{
"path": ".swcrc",
"chars": 304,
"preview": "{\n \"$schema\": \"https://swc.rs/schema.json\",\n \"jsc\": {\n \"parser\": {\n \"syntax\": \"typescript\",\n \"tsx\": true\n"
},
{
"path": "CHANGELOG.md",
"chars": 29329,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "CONTRIBUTING.md",
"chars": 4415,
"preview": "# Contributing to `rich-text`\n\n<p align=\"center\">\n <a href=\"http://makeapullrequest.com\">\n <img src=\"https://img.shi"
},
{
"path": "LICENSE",
"chars": 1067,
"preview": "MIT License\n\nCopyright (c) 2018 Contentful\n\nPermission is hereby granted, free of charge, to any person obtaining a copy"
},
{
"path": "README.md",
"chars": 5547,
"preview": "# rich-text\n\nMonorepo with Typescript libraries for handling and rendering Contentful Rich\nText documents.\n\n## Packages\n"
},
{
"path": "baseJestConfig.js",
"chars": 583,
"preview": "function getConfig(packageName) {\n return {\n collectCoverage: true,\n testPathIgnorePatterns: ['/dist/'],\n modu"
},
{
"path": "catalog-info.yaml",
"chars": 552,
"preview": "apiVersion: backstage.io/v1alpha1\nkind: System\nmetadata:\n name: rich-text\n description: |\n Monorepo with Typescript"
},
{
"path": "commitlint.config.js",
"chars": 67,
"preview": "module.exports = { extends: ['@commitlint/config-conventional'] };\n"
},
{
"path": "lerna.json",
"chars": 537,
"preview": "{\n \"$schema\": \"node_modules/lerna/schemas/lerna-schema.json\",\n \"npmClient\": \"pnpm\",\n \"version\": \"independent\",\n \"pac"
},
{
"path": "nx.json",
"chars": 1034,
"preview": "{\n \"$schema\": \"./node_modules/nx/schemas/nx-schema.json\",\n \"tasksRunnerOptions\": {\n \"default\": {\n \"runner\": \"n"
},
{
"path": "package.json",
"chars": 2154,
"preview": "{\n \"name\": \"@contentful/rich-text\",\n \"private\": true,\n \"description\": \"A monorepo for all NPM packages related to Ric"
},
{
"path": "packages/contentful-slatejs-adapter/.editorconfig",
"chars": 211,
"preview": "#root = true\n\n[*]\nindent_style = space\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_new"
},
{
"path": "packages/contentful-slatejs-adapter/.gitignore",
"chars": 120,
"preview": "node_modules\ncoverage\n.nyc_output\n.DS_Store\n*.log\n.vscode\n.idea\ndist\ncompiled\n.awcache\n.rpt2_cache\ndocs\n.vs/slnx.sqlite\n"
},
{
"path": "packages/contentful-slatejs-adapter/CHANGELOG.md",
"chars": 23521,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/contentful-slatejs-adapter/README.md",
"chars": 2335,
"preview": "# contentful-slatejs-adapter\n\nThis library provides an adapter to convert Slate's document structure to Contentful's ric"
},
{
"path": "packages/contentful-slatejs-adapter/jest.config.js",
"chars": 213,
"preview": "const getBaseConfig = require('../../baseJestConfig');\nconst package = require('./package.json');\nconst packageName = pa"
},
{
"path": "packages/contentful-slatejs-adapter/package.json",
"chars": 1633,
"preview": "{\n \"name\": \"@contentful/contentful-slatejs-adapter\",\n \"version\": \"16.2.1\",\n \"description\": \"\",\n \"keywords\": [],\n \"m"
},
{
"path": "packages/contentful-slatejs-adapter/rollup.config.ts",
"chars": 189,
"preview": "import config from '../../rollup.config';\nimport { main as outputFile, dependencies } from './package.json';\n\nexport def"
},
{
"path": "packages/contentful-slatejs-adapter/src/__test__/contentful-helpers.ts",
"chars": 1098,
"preview": "import {\n BLOCKS,\n INLINES,\n Document,\n Block,\n Inline,\n Text,\n Mark,\n TopLevelBlock,\n TopLevelBlockEnum,\n} fro"
},
{
"path": "packages/contentful-slatejs-adapter/src/__test__/contentful-to-slatejs-adapter.test.ts",
"chars": 16997,
"preview": "import * as Contentful from '@contentful/rich-text-types';\n\nimport toSlatejsDocument from '../contentful-to-slatejs-adap"
},
{
"path": "packages/contentful-slatejs-adapter/src/contentful-to-slatejs-adapter.ts",
"chars": 2091,
"preview": "import * as Contentful from '@contentful/rich-text-types';\n\nimport { getDataOrDefault } from './helpers';\nimport { fromJ"
},
{
"path": "packages/contentful-slatejs-adapter/src/helpers.ts",
"chars": 136,
"preview": "/**\n * Ensures that data defaults to an empty object.\n */\nexport const getDataOrDefault = (value?: Record<string, any>) "
},
{
"path": "packages/contentful-slatejs-adapter/src/index.ts",
"chars": 163,
"preview": "export { default as toSlatejsDocument } from './contentful-to-slatejs-adapter';\nexport { default as toContentfulDocument"
},
{
"path": "packages/contentful-slatejs-adapter/src/schema.ts",
"chars": 1765,
"preview": "import { BLOCKS, TEXT_CONTAINERS } from '@contentful/rich-text-types';\n\nimport { ContentfulElementNode } from './types';"
},
{
"path": "packages/contentful-slatejs-adapter/src/slatejs-to-contentful-adapter.ts",
"chars": 2270,
"preview": "import * as Contentful from '@contentful/rich-text-types';\n\nimport { getDataOrDefault } from './helpers';\nimport { Schem"
},
{
"path": "packages/contentful-slatejs-adapter/src/types/index.ts",
"chars": 996,
"preview": "import * as Contentful from '@contentful/rich-text-types';\n\nexport type SlateMarks = {\n // This is a workaround for Typ"
},
{
"path": "packages/contentful-slatejs-adapter/src/types/slate.ts",
"chars": 872,
"preview": "/* eslint-disable */\n\nnamespace Slate {\n // fixes \"Duplicate identifier\" when generating tests coverage\n export type N"
},
{
"path": "packages/contentful-slatejs-adapter/tsconfig.json",
"chars": 591,
"preview": "{\n \"compilerOptions\": {\n \"moduleResolution\": \"node\",\n \"target\": \"es5\",\n \"module\": \"es2015\",\n \"lib\": [\"es201"
},
{
"path": "packages/rich-text-from-markdown/CHANGELOG.md",
"chars": 26473,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/rich-text-from-markdown/README.md",
"chars": 1521,
"preview": "# rich-text-from-markdown\n\nA library to convert markdown to Contentful Rich Text document format.\n\n## Installation\n\nUsin"
},
{
"path": "packages/rich-text-from-markdown/jest.config.js",
"chars": 213,
"preview": "const getBaseConfig = require('../../baseJestConfig');\nconst package = require('./package.json');\nconst packageName = pa"
},
{
"path": "packages/rich-text-from-markdown/package.json",
"chars": 1665,
"preview": "{\n \"name\": \"@contentful/rich-text-from-markdown\",\n \"version\": \"16.2.1\",\n \"description\": \"convert markdown to rich tex"
},
{
"path": "packages/rich-text-from-markdown/rollup.config.js",
"chars": 189,
"preview": "import config from '../../rollup.config';\nimport { main as outputFile, dependencies } from './package.json';\n\nexport def"
},
{
"path": "packages/rich-text-from-markdown/src/__test__/helpers.ts",
"chars": 1071,
"preview": "import {\n TopLevelBlock,\n Document,\n BLOCKS,\n Block,\n Inline,\n Text,\n Mark,\n} from '@contentful/rich-text-types';"
},
{
"path": "packages/rich-text-from-markdown/src/__test__/index.test.ts",
"chars": 4763,
"preview": "import { BLOCKS, INLINES, MARKS } from '@contentful/rich-text-types';\n\nimport { richTextFromMarkdown } from '..';\n\nimpor"
},
{
"path": "packages/rich-text-from-markdown/src/__test__/real-world.md",
"chars": 2342,
"preview": "<!-- prettier-ignore-start -->\n\n# h1 Heading\n\n## h2 Heading\n\n### h3 Heading\n\n#### h4 Heading\n\n##### h5 Heading\n\n###### h"
},
{
"path": "packages/rich-text-from-markdown/src/__test__/real-world.test.ts",
"chars": 12444,
"preview": "import { BLOCKS, INLINES, MARKS } from '@contentful/rich-text-types';\nimport { readFileSync } from 'fs';\nimport path fro"
},
{
"path": "packages/rich-text-from-markdown/src/index.ts",
"chars": 9939,
"preview": "import {\n BLOCKS,\n Block,\n Document,\n Hyperlink,\n INLINES,\n Inline,\n Node,\n Text,\n TopLevelBlock,\n} from '@cont"
},
{
"path": "packages/rich-text-from-markdown/src/types/index.ts",
"chars": 263,
"preview": "export interface MarkdownNode extends MarkdownTree {\n depth: string;\n type: string;\n ordered: boolean;\n value: strin"
},
{
"path": "packages/rich-text-from-markdown/tsconfig.json",
"chars": 255,
"preview": "{\n \"extends\": \"../../tsconfig.json\",\n \"compilerOptions\": {\n \"declarationDir\": \"dist/types\",\n \"outDir\": \"dist/lib"
},
{
"path": "packages/rich-text-html-renderer/CHANGELOG.md",
"chars": 29824,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/rich-text-html-renderer/README.md",
"chars": 4943,
"preview": "# rich-text-html-renderer\n\nHTML renderer for the Contentful rich text field type.\n\n## Installation\n\nUsing [npm](http://n"
},
{
"path": "packages/rich-text-html-renderer/jest.config.js",
"chars": 213,
"preview": "const getBaseConfig = require('../../baseJestConfig');\nconst package = require('./package.json');\nconst packageName = pa"
},
{
"path": "packages/rich-text-html-renderer/package.json",
"chars": 1145,
"preview": "{\n \"name\": \"@contentful/rich-text-html-renderer\",\n \"version\": \"17.2.2\",\n \"main\": \"dist/rich-text-html-renderer.es5.js"
},
{
"path": "packages/rich-text-html-renderer/rollup.config.js",
"chars": 189,
"preview": "import config from '../../rollup.config';\nimport { main as outputFile, dependencies } from './package.json';\n\nexport def"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/embedded-entry.ts",
"chars": 348,
"preview": "import { BLOCKS, Document } from '@contentful/rich-text-types';\n\nexport default function (entry: Record<string, any>) {\n"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/embedded-resource.ts",
"chars": 372,
"preview": "import { Document, BLOCKS, ResourceLink } from '@contentful/rich-text-types';\n\nexport default function (resourceLink: Re"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/heading.ts",
"chars": 432,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default function (heading: string) {\n return {\n"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/hr.ts",
"chars": 732,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n content: [\n {\n content: [\n {\n"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/hyperlink.ts",
"chars": 759,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: 'document',\n data: {},\n content:"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/index.ts",
"chars": 744,
"preview": "export { default as hrDoc } from './hr';\nexport { default as hyperlinkDoc } from './hyperlink';\nexport { default as inva"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/inline-entity.ts",
"chars": 875,
"preview": "import { BLOCKS, Document, INLINES } from '@contentful/rich-text-types';\n\nexport default function inlineEntity(entry: Re"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/invalid-marks.ts",
"chars": 431,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: 'document',\n data: {},\n content:"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/invalid-type.ts",
"chars": 381,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: BLOCKS.DOCUMENT,\n data: {"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/mark.ts",
"chars": 434,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default function (mark: string) {\n return {\n nodeTyp"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/ol.ts",
"chars": 1233,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n data: {},\n content: [\n {\n data: {},"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/paragraph.ts",
"chars": 349,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: 'document',\n data: {},\n content:"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/quote.ts",
"chars": 544,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n data: {},\n content: [\n {\n data: {},"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/table-header.ts",
"chars": 2421,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: BLOCKS.DOCUMENT,\n data: {"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/table.ts",
"chars": 2407,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: BLOCKS.DOCUMENT,\n data: {"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/documents/ul.ts",
"chars": 1235,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n data: {},\n content: [\n {\n data: {},"
},
{
"path": "packages/rich-text-html-renderer/src/__test__/index.test.ts",
"chars": 18498,
"preview": "import { Block, BLOCKS, Document, INLINES, MARKS, ResourceLink } from '@contentful/rich-text-types';\nimport cloneDeep fr"
},
{
"path": "packages/rich-text-html-renderer/src/escapeHtml.ts",
"chars": 276,
"preview": "const escapeRegExp = /[\"'&<>]/g;\n\nconst escapeMap: Record<string, string> = {\n '\"': '"',\n '&': '&',\n \"'\": '&"
},
{
"path": "packages/rich-text-html-renderer/src/index.ts",
"chars": 6155,
"preview": "import {\n BLOCKS,\n Block,\n Document,\n INLINES,\n Inline,\n MARKS,\n Mark,\n Text,\n helpers,\n} from '@contentful/ric"
},
{
"path": "packages/rich-text-html-renderer/tsconfig.json",
"chars": 236,
"preview": "{\n \"extends\": \"../../tsconfig.json\",\n \"compilerOptions\": {\n \"declarationDir\": \"dist/types\",\n \"outDir\": \"dist/lib"
},
{
"path": "packages/rich-text-links/CHANGELOG.md",
"chars": 21836,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/rich-text-links/README.md",
"chars": 1407,
"preview": "# rich-text-links\n\nEntity (entry and asset) link extraction utilities for the Contentful rich text\nfield type.\n\n## Insta"
},
{
"path": "packages/rich-text-links/jest.config.js",
"chars": 213,
"preview": "const getBaseConfig = require('../../baseJestConfig');\nconst package = require('./package.json');\nconst packageName = pa"
},
{
"path": "packages/rich-text-links/package.json",
"chars": 1097,
"preview": "{\n \"name\": \"@contentful/rich-text-links\",\n \"version\": \"17.1.1\",\n \"main\": \"dist/rich-text-links.es5.js\",\n \"module\": \""
},
{
"path": "packages/rich-text-links/rollup.config.js",
"chars": 189,
"preview": "import config from '../../rollup.config';\nimport { main as outputFile, dependencies } from './package.json';\n\nexport def"
},
{
"path": "packages/rich-text-links/src/__test__/index.test.ts",
"chars": 31338,
"preview": "import { Document, BLOCKS, INLINES } from '@contentful/rich-text-types';\n\nimport {\n getAllRichTextResourceLinks,\n getR"
},
{
"path": "packages/rich-text-links/src/index.ts",
"chars": 4930,
"preview": "import {\n Block,\n BLOCKS,\n Document,\n Inline,\n INLINES,\n Link,\n Node,\n NodeData,\n ResourceLink,\n} from '@conten"
},
{
"path": "packages/rich-text-links/src/types/utils.ts",
"chars": 45,
"preview": "export type Maybe<T> = T | null | undefined;\n"
},
{
"path": "packages/rich-text-links/tsconfig.json",
"chars": 236,
"preview": "{\n \"extends\": \"../../tsconfig.json\",\n \"compilerOptions\": {\n \"declarationDir\": \"dist/types\",\n \"outDir\": \"dist/lib"
},
{
"path": "packages/rich-text-plain-text-renderer/CHANGELOG.md",
"chars": 24081,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/rich-text-plain-text-renderer/README.md",
"chars": 897,
"preview": "# rich-text-plain-text-renderer\n\nPlain text renderer for the Rich Text document.\n\n## Installation\n\nUsing [npm](http://np"
},
{
"path": "packages/rich-text-plain-text-renderer/bin/benchmark/get-rich-text-entity-links.ts",
"chars": 1107,
"preview": "import { BLOCKS, Document, Node } from '@contentful/rich-text-types';\n\nimport { documentToPlainTextString as docToString"
},
{
"path": "packages/rich-text-plain-text-renderer/bin/tsconfig.json",
"chars": 46,
"preview": "{\n \"extends\": \"../../../bin/tsconfig.json\"\n}\n"
},
{
"path": "packages/rich-text-plain-text-renderer/jest.config.js",
"chars": 213,
"preview": "const getBaseConfig = require('../../baseJestConfig');\nconst package = require('./package.json');\nconst packageName = pa"
},
{
"path": "packages/rich-text-plain-text-renderer/package.json",
"chars": 1181,
"preview": "{\n \"name\": \"@contentful/rich-text-plain-text-renderer\",\n \"version\": \"17.2.1\",\n \"main\": \"dist/rich-text-plain-text-ren"
},
{
"path": "packages/rich-text-plain-text-renderer/rollup.config.js",
"chars": 189,
"preview": "import config from '../../rollup.config';\nimport { main as outputFile, dependencies } from './package.json';\n\nexport def"
},
{
"path": "packages/rich-text-plain-text-renderer/src/__test__/index.test.ts",
"chars": 10349,
"preview": "import { Document, BLOCKS, INLINES } from '@contentful/rich-text-types';\n\nimport { documentToPlainTextString } from '../"
},
{
"path": "packages/rich-text-plain-text-renderer/src/index.ts",
"chars": 4029,
"preview": "import { Block, Inline, Node, helpers, BLOCKS, Document } from '@contentful/rich-text-types';\n\nexport interface Options "
},
{
"path": "packages/rich-text-plain-text-renderer/tsconfig.json",
"chars": 236,
"preview": "{\n \"extends\": \"../../tsconfig.json\",\n \"compilerOptions\": {\n \"declarationDir\": \"dist/types\",\n \"outDir\": \"dist/lib"
},
{
"path": "packages/rich-text-react-renderer/CHANGELOG.md",
"chars": 24198,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/rich-text-react-renderer/README.md",
"chars": 6577,
"preview": "# rich-text-react-renderer\n\nReact renderer for the Contentful rich text field type.\n\n## Installation\n\nUsing [npm](http:/"
},
{
"path": "packages/rich-text-react-renderer/jest.config.js",
"chars": 213,
"preview": "const getBaseConfig = require('../../baseJestConfig');\nconst package = require('./package.json');\nconst packageName = pa"
},
{
"path": "packages/rich-text-react-renderer/package.json",
"chars": 1415,
"preview": "{\n \"name\": \"@contentful/rich-text-react-renderer\",\n \"version\": \"16.2.1\",\n \"main\": \"dist/rich-text-react-renderer.es5."
},
{
"path": "packages/rich-text-react-renderer/rollup.config.js",
"chars": 259,
"preview": "import config from '../../rollup.config';\nimport { main as outputFile, dependencies } from './package.json';\n\nconst over"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/__snapshots__/index.test.tsx.snap",
"chars": 8189,
"preview": "// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing\n\nexports[`documentToReactComponents does not render unrecog"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/components/Document.tsx",
"chars": 252,
"preview": "import React, { FunctionComponent, ReactNode } from 'react';\n\ntype DocumentProps = {\n children: ReactNode;\n};\n\nconst Do"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/components/Paragraph.tsx",
"chars": 244,
"preview": "import React, { FunctionComponent, ReactNode } from 'react';\n\ntype ParagraphProps = {\n children: ReactNode;\n};\n\nconst P"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/components/Strong.tsx",
"chars": 242,
"preview": "import React, { FunctionComponent, ReactNode } from 'react';\n\ntype StrongProps = {\n children: ReactNode;\n};\n\nconst Stro"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/embedded-entry.ts",
"chars": 348,
"preview": "import { BLOCKS, Document } from '@contentful/rich-text-types';\n\nexport default function (entry: Record<string, any>) {\n"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/embedded-resource.ts",
"chars": 372,
"preview": "import { Document, BLOCKS, ResourceLink } from '@contentful/rich-text-types';\n\nexport default function (resourceLink: Re"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/heading.ts",
"chars": 432,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default function (heading: string) {\n return {\n"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/hr.ts",
"chars": 732,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n content: [\n {\n content: [\n {\n"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/hyperlink.ts",
"chars": 759,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: 'document',\n data: {},\n content:"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/index.ts",
"chars": 862,
"preview": "export { default as hrDoc } from './hr';\nexport { default as hyperlinkDoc } from './hyperlink';\nexport { default as inva"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/inline-entity.ts",
"chars": 875,
"preview": "import { BLOCKS, Document, INLINES } from '@contentful/rich-text-types';\n\nexport default function inlineEntity(entry: Re"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/invalid-marks.ts",
"chars": 431,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: 'document',\n data: {},\n content:"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/invalid-type.ts",
"chars": 381,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: BLOCKS.DOCUMENT,\n data: {"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/mark.ts",
"chars": 434,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default function (mark: string) {\n return {\n nodeTyp"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/multi-mark.ts",
"chars": 443,
"preview": "import { Document } from '@contentful/rich-text-types';\nexport default function () {\n return {\n nodeType: 'document'"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/ol.ts",
"chars": 1233,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n data: {},\n content: [\n {\n data: {},"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/paragraph.ts",
"chars": 349,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: 'document',\n data: {},\n content:"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/quote.ts",
"chars": 544,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n data: {},\n content: [\n {\n data: {},"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/table-header.ts",
"chars": 2421,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: BLOCKS.DOCUMENT,\n data: {"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/table.ts",
"chars": 2407,
"preview": "import { Document, BLOCKS } from '@contentful/rich-text-types';\n\nexport default {\n nodeType: BLOCKS.DOCUMENT,\n data: {"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/documents/ul.ts",
"chars": 1235,
"preview": "import { Document } from '@contentful/rich-text-types';\n\nexport default {\n data: {},\n content: [\n {\n data: {},"
},
{
"path": "packages/rich-text-react-renderer/src/__test__/index.test.tsx",
"chars": 18688,
"preview": "import React, { ReactNode } from 'react';\n\nimport { BLOCKS, Document, INLINES, MARKS, ResourceLink } from '@contentful/r"
},
{
"path": "packages/rich-text-react-renderer/src/index.tsx",
"chars": 4404,
"preview": "import React, { ReactNode } from 'react';\n\nimport {\n Block,\n BLOCKS,\n Document,\n Inline,\n INLINES,\n MARKS,\n Text,"
},
{
"path": "packages/rich-text-react-renderer/src/util/appendKeyToValidElement.ts",
"chars": 276,
"preview": "import { cloneElement, isValidElement, ReactNode } from 'react';\n\nexport function appendKeyToValidElement(element: React"
},
{
"path": "packages/rich-text-react-renderer/src/util/nodeListToReactComponents.tsx",
"chars": 1803,
"preview": "import React, { ReactNode } from 'react';\n\nimport { helpers, Mark } from '@contentful/rich-text-types';\n\nimport { Common"
},
{
"path": "packages/rich-text-react-renderer/tsconfig.json",
"chars": 241,
"preview": "{\n \"extends\": \"../../tsconfig.json\",\n \"compilerOptions\": {\n \"declarationDir\": \"dist/types\",\n \"outDir\": \"dist/lib"
},
{
"path": "packages/rich-text-types/CHANGELOG.md",
"chars": 31929,
"preview": "# Change Log\n\nAll notable changes to this project will be documented in this file.\nSee [Conventional Commits](https://co"
},
{
"path": "packages/rich-text-types/README.md",
"chars": 91,
"preview": "# rich-text-types\n\nType definitions and constants for the Contentful rich text field type.\n"
},
{
"path": "packages/rich-text-types/__mocks__/@lingui/core/macro.js",
"chars": 337,
"preview": "const t = ({ _id, message }) => message;\n\nconst plural = (count, options) => {\n let message = options.other;\n if (coun"
},
{
"path": "packages/rich-text-types/__test__/helpers.test.ts",
"chars": 4485,
"preview": "import { BLOCKS } from '../src/blocks';\nimport { helpers } from '../src/index';\nimport { Document, Mark } from '../src/t"
},
{
"path": "packages/rich-text-types/__test__/schemaConstraints.test.ts",
"chars": 975,
"preview": "import { BLOCKS } from '../src/blocks';\nimport { CONTAINERS, TEXT_CONTAINERS, VOID_BLOCKS } from '../src/schemaConstrain"
},
{
"path": "packages/rich-text-types/__test__/validation.test.ts",
"chars": 28516,
"preview": "import { BLOCKS } from '../src/blocks';\nimport { INLINES } from '../src/inlines';\nimport type { Document } from '../src/"
},
{
"path": "packages/rich-text-types/jest.config.js",
"chars": 243,
"preview": "/* eslint-disable */\n\nconst getBaseConfig = require('../../baseJestConfig');\nconst packageJson = require('./package.json"
},
{
"path": "packages/rich-text-types/package.json",
"chars": 1644,
"preview": "{\n \"name\": \"@contentful/rich-text-types\",\n \"version\": \"17.2.7\",\n \"main\": \"dist/cjs/index.js\",\n \"module\": \"dist/esm/i"
},
{
"path": "packages/rich-text-types/scripts/fix-esm-import-extensions.mjs",
"chars": 1266,
"preview": "// Rewrite relative `*.js` specifiers to `*.mjs` across built ESM files\nimport { readdir, readFile, writeFile } from 'no"
},
{
"path": "packages/rich-text-types/src/blocks.ts",
"chars": 701,
"preview": "/**\n * Map of all Contentful block types. Blocks contain inline or block nodes.\n */\nexport enum BLOCKS {\n DOCUMENT = 'd"
},
{
"path": "packages/rich-text-types/src/emptyDocument.ts",
"chars": 505,
"preview": "import { BLOCKS } from './blocks.js';\nimport { Document } from './types.js';\n\n/**\n * A rich text document considered to "
},
{
"path": "packages/rich-text-types/src/helpers.ts",
"chars": 2343,
"preview": "import { BLOCKS } from './blocks.js';\nimport { INLINES } from './inlines.js';\nimport { Block, Inline, Node, Text, Docume"
},
{
"path": "packages/rich-text-types/src/index.ts",
"chars": 459,
"preview": "export { BLOCKS } from './blocks.js';\nexport { INLINES } from './inlines.js';\nexport { MARKS } from './marks.js';\n\nexpor"
},
{
"path": "packages/rich-text-types/src/inlines.ts",
"chars": 572,
"preview": "/**\n * Map of all Contentful inline types. Inline contain inline or text nodes.\n *\n * @note This should be kept in alpha"
},
{
"path": "packages/rich-text-types/src/marks.ts",
"chars": 237,
"preview": "/**\n * Map of all Contentful marks.\n */\nexport enum MARKS {\n BOLD = 'bold',\n ITALIC = 'italic',\n UNDERLINE = 'underli"
},
{
"path": "packages/rich-text-types/src/nodeTypes.ts",
"chars": 4386,
"preview": "import { BLOCKS } from './blocks.js';\nimport { INLINES } from './inlines.js';\nimport { Block, Inline, ListItemBlock, Tex"
},
{
"path": "packages/rich-text-types/src/schemaConstraints.ts",
"chars": 3511,
"preview": "import { BLOCKS } from './blocks.js';\nimport { INLINES } from './inlines.js';\nimport { MARKS } from './marks.js';\n\nexpor"
},
{
"path": "packages/rich-text-types/src/types.ts",
"chars": 912,
"preview": "import { BLOCKS } from './blocks.js';\nimport { INLINES } from './inlines.js';\nimport { ListItemBlockEnum, TopLevelBlockE"
},
{
"path": "packages/rich-text-types/src/validator/assert.ts",
"chars": 6262,
"preview": "import {\n maxSizeError,\n typeMismatchError,\n enumError,\n unknownPropertyError,\n requiredPropertyError,\n minSizeErr"
},
{
"path": "packages/rich-text-types/src/validator/errors.ts",
"chars": 1763,
"preview": "import type { Path } from './path.js';\nimport { ValidationError } from './types.js';\n\nexport const typeMismatchError = ("
},
{
"path": "packages/rich-text-types/src/validator/index.ts",
"chars": 3368,
"preview": "import { BLOCKS } from '../blocks.js';\nimport { INLINES } from '../inlines.js';\nimport { CONTAINERS, LIST_ITEM_BLOCKS, T"
},
{
"path": "packages/rich-text-types/src/validator/node.ts",
"chars": 4396,
"preview": "import {\n AssetHyperlink,\n AssetLinkBlock,\n EntryHyperlink,\n EntryLinkBlock,\n Hyperlink,\n ResourceLinkBlock,\n Res"
},
{
"path": "packages/rich-text-types/src/validator/path.ts",
"chars": 419,
"preview": "export class Path {\n constructor(private readonly path: (string | number)[] = []) {}\n\n of = (element: string | number)"
},
{
"path": "packages/rich-text-types/src/validator/text.ts",
"chars": 848,
"preview": "import { Text } from '../types.js';\nimport { ObjectAssertion } from './assert.js';\nimport type { Path } from './path.js'"
},
{
"path": "packages/rich-text-types/src/validator/types.ts",
"chars": 348,
"preview": "export type ValidationError = {\n name: string;\n type?: string;\n value?: Record<string, any> | string | number | boole"
},
{
"path": "packages/rich-text-types/tsconfig.json",
"chars": 450,
"preview": "{\n \"extends\": \"../../tsconfig.json\",\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"esnext\",\n \"module"
},
{
"path": "pnpm-workspace.yaml",
"chars": 85,
"preview": "packages:\n - 'packages/*'\nlinkWorkspacePackages: true\npreferWorkspacePackages: true\n"
},
{
"path": "renovate.json",
"chars": 128,
"preview": "{\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n \"extends\": [\n \"local>contentful/renovate-config"
},
{
"path": "rollup.config.js",
"chars": 1174,
"preview": "import commonjs from '@rollup/plugin-commonjs';\nimport resolve from '@rollup/plugin-node-resolve';\nimport swc from '@rol"
},
{
"path": "tsconfig.json",
"chars": 531,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"es5\",\n \"module\": \"es2015\",\n \"lib\": [\n \"es2015\",\n \"es2016\",\n "
}
]
About this extraction
This page contains the full source code of the contentful/rich-text GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 160 files (520.0 KB), approximately 158.4k tokens, and a symbol index with 180 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.