index
int64
0
0
repo_id
stringlengths
16
181
file_path
stringlengths
28
270
content
stringlengths
1
11.6M
__index_level_0__
int64
0
10k
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/README.md
# Sanity Block Tools Various tools for processing Sanity block content. Mostly used internally in the Studio code, but it got some nice functions (especially `htmlToBlocks`) which is handy when you are importing data from HTML into your dataset as block text. **NOTE:** To use `@sanity/block-tools` in a Node.js script...
1,500
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/changelog.md
2018-12-13: BREAKING: Changed params for `htmlToBlocks` from `(html, options={blockContentType})` to `(html, blockContentType, options={}` as blockContentType is now required. 2019-10-16: `normalizeBlock` now takes a second parameter `options`. You can send in `options.allowedDecorators` which are the allowed decorato...
1,501
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/jest.config.cjs
'use strict' const {createJestConfig} = require('../../../test/config.cjs') module.exports = createJestConfig({ displayName: require('./package.json').name, testEnvironment: 'node', rootDir: __dirname, setupFilesAfterEnv: ['./test/setup.ts'], })
1,502
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/package.config.ts
import {defineConfig} from '@sanity/pkg-utils' import baseConfig from '../../../package.config' export default defineConfig({...baseConfig})
1,503
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/package.json
{ "name": "@sanity/block-tools", "version": "3.20.1", "description": "Can format HTML, Slate JSON or Sanity block array into any other format.", "keywords": [ "sanity", "cms", "headless", "realtime", "content", "block-tools" ], "homepage": "https://www.sanity.io/", "bugs": { "u...
1,504
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/tsconfig.json
{ "extends": "../../../tsconfig.settings", "include": ["./src", "./test"], "compilerOptions": { "composite": true, "declarationDir": "./lib/dts", "rootDir": ".", "outDir": "./lib/dts", "jsx": "react-jsx" }, "references": [{"path": "../schema/tsconfig.lib.json"}, {"path": "../types/tsconfi...
1,505
0
petrpan-code/sanity-io/sanity/packages/@sanity
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/tsconfig.lib.json
{ "extends": "../../../tsconfig.settings", "include": ["./src"], "exclude": [ "./src/**/__fixtures__", "./src/**/__mocks__", "./src/**/__workshop__", "./src/**/*.test.ts", "./src/**/*.test.tsx" ], "compilerOptions": { "composite": true, "rootDir": ".", "outDir": "./lib/dts", ...
1,506
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/constants.ts
import {uniq} from 'lodash' export interface PartialBlock { _type: string markDefs: string[] style: string level?: number listItem?: string } export const PRESERVE_WHITESPACE_TAGS = ['pre', 'textarea', 'code'] export const BLOCK_DEFAULT_STYLE = 'normal' export const DEFAULT_BLOCK: PartialBlock = Object.fr...
1,507
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/index.ts
import type {ArraySchemaType, PortableTextTextBlock} from '@sanity/types' import blockContentTypeFeatures from './util/blockContentTypeFeatures' import HtmlDeserializer from './HtmlDeserializer' import {normalizeBlock} from './util/normalizeBlock' import {BlockContentFeatures, HtmlDeserializerOptions, TypedObject} from...
1,508
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/types.ts
import type {ComponentType} from 'react' import type { ArraySchemaType, ObjectSchemaType, PortableTextObject, SpanSchemaType, TitledListValue, } from '@sanity/types' /** * @public */ export interface BlockContentFeatures { styles: TitledListValue<string>[] decorators: TitledListValue<string>[] annota...
1,509
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/helpers.ts
import {ArraySchemaType, PortableTextTextBlock, isPortableTextTextBlock} from '@sanity/types' import {isEqual} from 'lodash' import {DEFAULT_BLOCK, PRESERVE_WHITESPACE_TAGS} from '../constants' import {resolveJsType} from '../util/resolveJsType' import type { BlockEnabledFeatures, HtmlParser, MinimalBlock, Mini...
1,510
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/index.ts
import type { ArraySchemaType, PortableTextBlock, PortableTextObject, PortableTextTextBlock, } from '@sanity/types' import {flatten} from 'lodash' import {findBlockType} from '../util/findBlockType' import {resolveJsType} from '../util/resolveJsType' import type { ArbitraryTypedObject, DeserializerRule, H...
1,511
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/gdocs.ts
import {_XPathResult} from './xpathResult' export default (html: string, doc: Document): Document => { const gDocsRootNode = doc .evaluate( '//b[contains(@id, "docs-internal-guid")]', doc, null, _XPathResult.ORDERED_NODE_ITERATOR_TYPE, null, ) .iterateNext() if (gDocsRoot...
1,512
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/html.ts
import {_XPathResult} from './xpathResult' // Remove this cruft from the document const unwantedWordDocumentPaths = [ '/html/text()', '/html/head/text()', '/html/body/text()', '/html/body/ul/text()', '/html/body/ol/text()', '//comment()', '//style', '//xml', '//script', '//meta', '//link', ] exp...
1,513
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/index.ts
import preprocessWhitespace from './whitespace' import preprocessHTML from './html' import preprocessWord from './word' import preprocessGDocs from './gdocs' export default [preprocessWhitespace, preprocessWord, preprocessGDocs, preprocessHTML]
1,514
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/whitespace.ts
import {PRESERVE_WHITESPACE_TAGS} from '../../constants' import {_XPathResult} from './xpathResult' export default (_: string, doc: Document): Document => { // Recursively process all nodes. function processNode(node: Node) { // If this is a text node and not inside a tag where whitespace should be preserved, ...
1,515
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/word.ts
import {_XPathResult} from './xpathResult' const WORD_HTML_REGEX = /(class="?Mso|style=(?:"|')[^"]*?\bmso-|w:WordDocument|<o:\w+>|<\/font>)/ // xPaths for elements that will be removed from the document const unwantedPaths = [ '//o:p', "//span[@style='mso-list:Ignore']", "//span[@style='mso-list: Ignore']", ] ...
1,516
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/preprocessors/xpathResult.ts
// We need this here if run server side export const _XPathResult = { ANY_TYPE: 0, NUMBER_TYPE: 1, STRING_TYPE: 2, BOOLEAN_TYPE: 3, UNORDERED_NODE_ITERATOR_TYPE: 4, ORDERED_NODE_ITERATOR_TYPE: 5, UNORDERED_NODE_SNAPSHOT_TYPE: 6, ORDERED_NODE_SNAPSHOT_TYPE: 7, ANY_UNORDERED_NODE_TYPE: 8, FIRST_ORDERE...
1,517
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/rules/gdocs.ts
import type {ArraySchemaType} from '@sanity/types' import type {BlockEnabledFeatures, DeserializerRule} from '../../types' import { BLOCK_DEFAULT_STYLE, DEFAULT_BLOCK, DEFAULT_SPAN, HTML_BLOCK_TAGS, HTML_HEADER_TAGS, HTML_LIST_CONTAINER_TAGS, } from '../../constants' import {isElement, tagName} from '../hel...
1,518
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/rules/html.ts
import type {ArraySchemaType} from '@sanity/types' import {randomKey} from '../../util/randomKey' import {isElement, tagName} from '../helpers' import { DEFAULT_BLOCK, DEFAULT_SPAN, HTML_BLOCK_TAGS, HTML_HEADER_TAGS, HTML_SPAN_TAGS, HTML_LIST_CONTAINER_TAGS, HTML_LIST_ITEM_TAGS, HTML_DECORATOR_TAGS, P...
1,519
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/rules/index.ts
import type {ArraySchemaType} from '@sanity/types' import type {BlockEnabledFeatures, DeserializerRule} from '../../types' import createHTMLRules from './html' import createGDocsRules from './gdocs' import createWordRules from './word' export function createRules( blockContentType: ArraySchemaType, options: BlockE...
1,520
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/HtmlDeserializer/rules/word.ts
import type {DeserializerRule} from '../../types' import {DEFAULT_BLOCK, BLOCK_DEFAULT_STYLE} from '../../constants' import {isElement, tagName} from '../helpers' function getListItemStyle(el: Node): string | undefined { const style = isElement(el) && el.getAttribute('style') if (!style) { return undefined }...
1,521
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/util/blockContentTypeFeatures.ts
import { ArraySchemaType, BlockSchemaType, EnumListProps, isBlockChildrenObjectField, isBlockListObjectField, isBlockSchemaType, isBlockStyleObjectField, isObjectSchemaType, isTitledListValue, ObjectSchemaType, SpanSchemaType, TitledListValue, } from '@sanity/types' import {BlockContentFeatures,...
1,522
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/util/findBlockType.ts
import type {BlockSchemaType, SchemaType} from '@sanity/types' export function findBlockType(type: SchemaType): type is BlockSchemaType { if (type.type) { return findBlockType(type.type) } if (type.name === 'block') { return true } return false }
1,523
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/util/normalizeBlock.ts
import {PortableTextTextBlock, PortableTextSpan, isPortableTextSpan} from '@sanity/types' import {isEqual} from 'lodash' import {TypedObject} from '../types' import {randomKey} from './randomKey' /** * Block normalization options * * @public */ export interface BlockNormalizationOptions { /** * Decorator name...
1,524
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/util/randomKey.ts
import getRandomValues from 'get-random-values-esm' // WHATWG crypto RNG - https://w3c.github.io/webcrypto/Overview.html function whatwgRNG(length = 16) { const rnds8 = new Uint8Array(length) getRandomValues(rnds8) return rnds8 } const byteToHex: string[] = [] for (let i = 0; i < 256; ++i) { byteToHex[i] = (i...
1,525
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/src/util/resolveJsType.ts
const toString = Object.prototype.toString // Copied from https://github.com/ForbesLindesay/type-of // but inlined to have fine grained control export function resolveJsType(val: unknown) { switch (toString.call(val)) { case '[object Function]': return 'function' case '[object Date]': return 'dat...
1,526
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/.eslintrc
{ "env": { "node": true }, "rules": { "no-sync": 0, "max-nested-callbacks": ["error", 4] } }
1,527
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/setup.ts
export {} let mockTestKey = 0 jest.mock('../src/util/randomKey', () => { return { randomKey: jest.fn().mockImplementation(() => { return `randomKey${mockTestKey++}` }), } }) beforeEach(() => { // eslint-disable-line import/unambiguous mockTestKey = 0 })
1,528
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/fixtures/customFeatures.json
{ "styles": [ {"title": "Normal", "value": "normal"}, {"title": "H1", "value": "h1"}, {"title": "H2", "value": "h2"} ], "decorators": [ {"title": "Strong", "value": "strong"}, {"title": "Emphasis", "value": "em"} ], "annotations": [ { "title": "Author", "type": { "j...
1,529
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/fixtures/customSchema.ts
import {Schema} from '@sanity/schema' export default Schema.compile({ name: 'withCustomBlockType', types: [ { type: 'document', name: 'author', fields: [{type: 'string', name: 'name', title: 'Name'}], }, { name: 'customBlock', type: 'block', // Only allow these style...
1,530
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/fixtures/defaultSchema.ts
import {Schema} from '@sanity/schema' export default Schema.compile({ name: 'withDefaultBlockType', types: [ { type: 'object', name: 'blogPost', fields: [ { title: 'Title', type: 'string', name: 'title', }, { title: 'Body', ...
1,531
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/index.test.ts
import * as fs from 'fs' import * as assert from 'assert' import * as path from 'path' import {JSDOM} from 'jsdom' import * as blockTools from '../../../src' import type {BlockTestFn} from './types' describe('HtmlDeserializer', () => { const tests = fs.readdirSync(__dirname) tests.forEach((test) => { if (test[...
1,532
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/types.ts
import type {TypedObject} from '../../../src/types' import {getBlockContentFeatures, normalizeBlock, htmlToBlocks} from '../../../src' interface BlockContentFunctions { getBlockContentFeatures: typeof getBlockContentFeatures normalizeBlock: typeof normalizeBlock htmlToBlocks: typeof htmlToBlocks } export type B...
1,533
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/annotations/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,534
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/annotations/input.html
<html> <body> <p> <a href='http://test.com'>I am a <strong>strong</strong> link</a> <em>and <a href='http://foo.bar'>I am a emphasized link</a></em> </p> <p> <a href='http://another.com'>I am a totally different link</a> </p> </body> </html>
1,535
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/annotations/output.json
[ { "_key": "randomKey3", "_type": "block", "children": [ { "_key": "randomKey30", "_type": "span", "marks": ["randomKey0"], "text": "I am a " }, { "_key": "randomKey31", "_type": "span", "marks": ["randomKey0", "strong"], "...
1,536
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/blockTags/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,537
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/blockTags/input.html
<html> <body> <p>Paragraph</p> <h1>H1</h1> <h2>H2</h2> <h3>H3</h3> <h4>H4</h4> <h5>H5</h5> <h6>H6</h6> <blockquote>Blockquote</blockquote> </body> </html>
1,538
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/blockTags/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [ { "_key": "randomKey00", "_type": "span", "marks": [], "text": "Paragraph" } ], "markDefs": [], "style": "normal" }, { "_key": "randomKey1", "_type": "block", "children": [ ...
1,539
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/codeBlock/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' import {DeserializerRule} from '../../../../src/types' import {isElement} from '../../../../src/HtmlDeserializer/helpers' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name ...
1,540
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/codeBlock/input.html
<html> <body> <em>Hei</em> <pre><code>const foo = 'bar'</code></pre> </body> </html>
1,541
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/codeBlock/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [ { "_key": "randomKey00", "_type": "span", "marks": ["em"], "text": "Hei" } ], "markDefs": [], "style": "normal" }, { "_key": "randomKey1", "_type": "code", "text": "const foo =...
1,542
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/complex/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,543
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/complex/input.html
<html> <body> <h1>Jeg er overskrift</h1> <!-- Jeg er en kommentar --> <p> Hei jeg er en paragraph.<br/> Jeg har <strong>strong</strong> og <b>bold</b> og <i>italic</i> og <em>emphasis</em> og greier og greier. <br /> Ja, og så <del> < del></del> <br /> Ja, og så <strike> < str...
1,544
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/complex/output.json
[ { "_type": "block", "markDefs": [], "style": "h1", "children": [ { "_type": "span", "marks": [], "text": "Jeg er overskrift", "_key": "randomKey10" } ], "_key": "randomKey1" }, { "_type": "block", "markDefs": [], "style": "normal", ...
1,545
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/customRules/index.ts
import type {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' import type {DeserializerRule} from '../../../../src/types' import {isElement} from '../../../../src/HtmlDeserializer/helpers' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => f...
1,546
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/customRules/input.html
<html> <body> <em>Hei</em> <pre><code>const foo = 'bar'</code></pre> <blockquote> <p>Quote <strong>with emphasis</strong></p> <em>Emphasis!</em> </blockquote> <p><a href="http://foo"><img src="http://image.gif" alt="Test image" /></a></p> </body> </html>
1,547
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/customRules/output.json
[ { "_type": "block", "markDefs": [], "style": "normal", "children": [ { "_type": "span", "marks": ["strong"], "text": "Hei", "_key": "randomKey10" }, { "_type": "span", "marks": ["code"], "text": "const foo = 'bar'", "_...
1,548
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/customSchema/index.ts
import customSchema from '../../../fixtures/customSchema' import type {BlockTestFn} from '../types' const blockContentType = customSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(ht...
1,549
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/customSchema/input.html
<html> <body> <h6>A heading that is not allowed</h6> <p> <strong>Strong text but <em>this is also emphasized and <strike>striked</strike> <sub>and subbed</sub> <sup>and supped</sup> <ins>and inserted</ins> <mark>and marked</mark> <del>a...
1,550
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/customSchema/output.json
[ { "_type": "customBlock", "markDefs": [], "style": "normal", "children": [ { "_type": "span", "marks": [], "text": "A heading that is not allowed" } ], "_key": "randomKey0" }, { "_type": "customBlock", "markDefs": [], "style": "normal", ...
1,551
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/decorators/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,552
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/decorators/input.html
<html> <body> <p> <strong>Strong text but <em>this is also emphasized and <strike>striked</strike> </em> </strong> <em>Just emphasized</em> </p> </body> </html>
1,553
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/decorators/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [ { "_key": "randomKey00", "_type": "span", "marks": ["strong"], "text": "Strong text but " }, { "_key": "randomKey01", "_type": "span", "marks": ["strong", "em"], "tex...
1,554
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild1/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,555
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild1/input.html
<p> Asylsøkere, flyktninger og familiegjenforente har samme rett til helsetjenester som den øvrige befolkningen. Retten til helsehjelp for asylsøkere gjelder fra de kommer til Norge for å søke beskyttelse. Flyktninger og familiegjenforente har også fulle rettigheter til helsehjelp fra de ankommer landet. For definisjo...
1,556
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild1/output.json
[ { "_type": "block", "markDefs": [ { "_key": "randomKey0", "_type": "link", "href": "https://www.udi.no/ord-og-begreper/" } ], "style": "normal", "children": [ { "_type": "span", "marks": [], "text": "Asylsøkere, flyktninger og fam...
1,557
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild2/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' import {isElement} from '../../../../src/HtmlDeserializer/helpers' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, bl...
1,558
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild2/input.html
<p>You might think you’re writing JSX:</p> <pre><code class="jsx">&lt;marquee bgcolor=&quot;#ffa7c4&quot;&gt;hi&lt;/marquee&gt; </code></pre> <p>But really, you’re calling a function:</p> <pre><code class="jsx">React.createElement( /* type */ 'marquee', /* props */ { bgcolor: '#ffa7c4' }, /* children */ 'hi' ...
1,559
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild2/output.json
[ { "_key": "randomKey9", "children": [ { "_type": "span", "marks": [], "text": "You might think you’re writing JSX:", "_key": "randomKey90" } ], "markDefs": [], "_type": "block", "style": "normal" }, { "_type": "code", "language": "javas...
1,560
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild3/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' import {isElement} from '../../../../src/HtmlDeserializer/helpers' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, bl...
1,561
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild3/input.html
<section id="contentWrapperSection" class="o-content-wrapper o-content-border js-blur-bg js-main-wrapper clearfix"> <div class="flexi_hero_par parsys"><div class="ghost section"> </div> <div class="component-wrapper section"> <noscript class="deferred-styles"></noscript> <div class="clearfix component rich-text-v2" dat...
1,562
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild3/output.json
[ { "_type": "block", "markDefs": [], "style": "normal", "children": [ { "_type": "span", "marks": [], "text": " ", "_key": "randomKey390" } ], "_key": "randomKey39" }, { "_type": "block", "markDefs": [], "style": "normal", "child...
1,563
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild4/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,564
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild4/input.html
<h1 class=""rtecenter""> <strong>Cornerstone's Adam Miller Recognized as a 2019 Best CEO for Women</strong></h1> ​ <div class=""rtecenter""> <em>Global talent management and talent experience leader earns spot on Comparably's 2019 Best CEOs for Women list as ranked by female employees at the company</em></div> <br...
1,565
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild4/output.json
[ { "_type": "block", "markDefs": [], "style": "h1", "children": [ { "_type": "span", "marks": ["strong"], "text": "Cornerstone's Adam Miller Recognized as a 2019 Best CEO for Women", "_key": "randomKey00" } ], "_key": "randomKey0" }, { "_typ...
1,566
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild5/index.ts
import {JSDOM} from 'jsdom' import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' import {DeserializerRule} from '../../../../src/types' import {isElement} from '../../../../src/HtmlDeserializer/helpers' const blockContentType = defaultSchema .get('blogPost') .fields.find...
1,567
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild5/input.html
<p>TRANSFORM is currently supporting over <a href="https://www.transform.global/modules/help/Market.aspx?id=6&amp;appid=2">45 projects across 11 countries</a>, which have reached more than a million people so far.</p> <CTA> <h2>Unlocking the power of markets</h2> <img src="/Users/davidhoulker/Code/unilever/unileve...
1,568
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/fromTheWild5/output.json
[ { "_key": "randomKey2", "_type": "block", "children": [ { "_key": "randomKey20", "_type": "span", "marks": [], "text": "TRANSFORM is currently supporting over " }, { "_key": "randomKey21", "_type": "span", "marks": ["randomKey0"],...
1,569
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/gdocs/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,570
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/gdocs/input.html
<html> <body> <!--StartFragment--><meta charset="utf-8"><b style="font-weight:normal;" id="docs-internal-guid-21a47c78-7fff-15da-47f1-302ae3839dbc"><h1 dir="ltr" style="line-height:1.2;margin-right: -1.5pt;margin-top:16pt;margin-bottom:0pt;"><span style="font-size:13.999999999999998pt;font-family:'Playfair Display',ser...
1,571
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/gdocs/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [{"_key": "randomKey00", "_type": "span", "marks": ["strong"], "text": "Skills"}], "markDefs": [], "style": "h1" }, { "_key": "randomKey1", "_type": "block", "children": [ { "_key": "randomKey10", "_type"...
1,572
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/githubIssue/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,573
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/githubIssue/input.html
<html> <div> <div id="issue_783" class="Box-row Box-row--focus-gray p-0 js-navigation-item js-issue-row selectable unread" data-id="386749352" aria-selected="false" > <div class="d-table table-fixed width-full Box-row--drag-hide position-relative"> <!-- drag handles --> <!-- checkbo...
1,574
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/githubIssue/output.json
[ { "_key": "randomKey8", "_type": "block", "children": [ { "_key": "randomKey80", "_type": "span", "marks": ["randomKey0"], "text": "The preview API seems broken" }, { "_key": "randomKey81", "_type": "span", "marks": [], "t...
1,575
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,576
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/input.html
<html> <body> <ul> <li> 1 a <ul> <li> 2 a <ul> <li>3 a</li> <li>3 b</li> </ul> </li> <li> 2 b </li> </ul> </li> <li> ...
1,577
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/lists/output.json
[ { "_key": "randomKey1", "_type": "block", "children": [ { "_key": "randomKey10", "_type": "span", "marks": [], "text": "1 a" } ], "level": 1, "listItem": "bullet", "markDefs": [], "style": "normal" }, { "_key": "randomKey2", "_t...
1,578
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/nestedContainers/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,579
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/nestedContainers/input.html
<html> <body> <p>Header</p> <blockquote> I'm a quote. <blockquote> And I'm a quote within a quote. <blockquote> And I'm a quote within a quote within a quote. <blockquote> And I'm a quote within a quote within a quote within a quote. <p>I am a stupid paragrap...
1,580
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/nestedContainers/output.json
[ { "_type": "block", "markDefs": [], "style": "normal", "children": [ { "_type": "span", "marks": [], "text": "Header", "_key": "randomKey10" } ], "_key": "randomKey1" }, { "_type": "block", "style": "blockquote", "markDefs": [], ...
1,581
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/simple/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,582
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/simple/input.html
<p> This is markdown with <code>code</code>, <strong>strong</strong>, and <em>emphasis</em>. And <a href="https://www.sanity.io">a link</a> too! </p>
1,583
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/simple/output.json
[ { "_key": "randomKey1", "_type": "block", "children": [ { "_key": "randomKey10", "_type": "span", "marks": [], "text": "This is markdown with " }, { "_key": "randomKey11", "_type": "span", "marks": ["code"], "text": "code"...
1,584
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace1/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,585
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace1/input.html
<meta charset='utf-8'><span style="color: rgb(0, 0, 0); font-family: Times; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; w...
1,586
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace1/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [ { "_key": "randomKey00", "_type": "span", "marks": [], "text": "Jeg har " }, { "_key": "randomKey01", "_type": "span", "marks": ["strong"], "text": "strong" }, ...
1,587
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace2/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,588
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace2/input.html
<html> <body> <p> I should not have any whitepace in the start, and none in the end </p> <p> I should not have any whitepace in the start, and none in the end <span> </span> </p> <p> I should not have any whitepace in the start, and none in the end <span><em> I have one in the beginning but none in th...
1,589
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace2/output.json
[ { "_type": "block", "markDefs": [], "style": "normal", "children": [ { "_type": "span", "marks": [], "text": "I should not have any whitepace in the start, and none in the end", "_key": "randomKey40" } ], "_key": "randomKey4" }, { "_type": ...
1,590
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace3/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,591
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace3/input.html
<html> <body> <p> <span>This</span> <span>is</span> <span>a</span> <span>test</span> </p> </body> </html>
1,592
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespace3/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [ { "_key": "randomKey00", "_type": "span", "marks": [], "text": "This is a test" } ], "markDefs": [], "style": "normal" } ]
1,593
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespaceInPreTags/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,594
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespaceInPreTags/input.html
<html> <body> <pre> # 1. Clone the repository: git clone ... # 2. Navigate to the client directory: cd ... # 3. Create a new Python virtual environment: python3 -m venv ... </pre> <textarea> # 1. Clone the repository: git clone ... # 2. Navigate to the...
1,595
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/whitespaceInPreTags/output.json
[ { "_key": "randomKey0", "children": [ { "_type": "span", "marks": [], "text": "# 1. Clone the repository:\n git clone ...\n # 2. Navigate to the client directory:\n cd ...\n # 3. Create a new Python virtual environment:\n python3 -m venv ...\n", ...
1,596
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/word/index.ts
import {BlockTestFn} from '../types' import defaultSchema from '../../../fixtures/defaultSchema' const blockContentType = defaultSchema .get('blogPost') .fields.find((field: any) => field.name === 'body').type const testFn: BlockTestFn = (html, blockTools, commonOptions) => { return blockTools.htmlToBlocks(html...
1,597
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/word/input.html
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta name=Title content=""> <meta name=Keywords content=""> <meta http-equiv=Content-Type content="...
1,598
0
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer
petrpan-code/sanity-io/sanity/packages/@sanity/block-tools/test/tests/HtmlDeserializer/word/output.json
[ { "_key": "randomKey0", "_type": "block", "children": [ { "_key": "randomKey00", "_type": "span", "marks": ["strong"], "text": "Keywords" } ], "markDefs": [], "style": "normal" }, { "_key": "randomKey1", "_type": "block", "children"...
1,599