Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 1, 2023
1 parent 992f0e4 commit 09c707c
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ export function usePasteHandler( props ) {
mode = 'BLOCKS';
}

// If the data comes from a rich text instance, we can directly use it
// without filtering the data. The filters are only meant for externally
// pasted content and remove inline styles.
const content = pasteHandler( {
HTML: html,
plainText,
Expand Down
15 changes: 1 addition & 14 deletions packages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,6 @@ _Returns_

- `boolean`: True if a block contains at least one child blocks with inserter support and false otherwise.

### htmlToBlocks

Converts HTML directly to blocks. Looks for a matching transform for each top-level tag. The HTML should be filtered to not have any text between top-level tags and formatted in a way that blocks can handle the HTML.

_Parameters_

- _html_ `string`: HTML to convert.
- _handler_ `Function`: The handler calling htmlToBlocks: either rawHandler or pasteHandler.

_Returns_

- `Array`: An array of blocks.

### isReusableBlock

Determines whether or not the given block is a reusable block. This is a special block type that is used to point to a global block stored via the API.
Expand Down Expand Up @@ -471,7 +458,7 @@ _Parameters_
- _options.mode_ `[string]`: Handle content as blocks or inline content. _ 'AUTO': Decide based on the content passed. _ 'INLINE': Always handle as inline content, and return string. \* 'BLOCKS': Always handle as blocks, and return array of blocks.
- _options.tagName_ `[Array]`: The tag into which content will be inserted.
- _options.preserveWhiteSpace_ `[boolean]`: Whether or not to preserve consequent white space.
- _options.disableFilters_ `[boolean]`:
- _options.disableFilters_ `[boolean]`: Whether or not to filter non semantic content.

_Returns_

Expand Down
1 change: 0 additions & 1 deletion packages/blocks/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export {
export {
pasteHandler,
rawHandler,
htmlToBlocks,
deprecatedGetPhrasingContentSchema as getPhrasingContentSchema,
} from './raw-handling';

Expand Down
1 change: 0 additions & 1 deletion packages/blocks/src/api/raw-handling/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import shortcodeConverter from './shortcode-converter';
import { deepFilterHTML, getBlockContentSchema } from './utils';

export { pasteHandler } from './paste-handler';
export { htmlToBlocks } from './html-to-blocks';

export function deprecatedGetPhrasingContentSchema( context ) {
deprecated( 'wp.blocks.getPhrasingContentSchema', {
Expand Down
5 changes: 1 addition & 4 deletions packages/blocks/src/api/raw-handling/paste-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function maybeConvertParagraphToInline( { blocks, plainText, mode } ) {
* @param {Array} [options.tagName] The tag into which content will be inserted.
* @param {boolean} [options.preserveWhiteSpace] Whether or not to preserve consequent white space.
*
* @param {boolean} [options.disableFilters]
* @param {boolean} [options.disableFilters] Whether or not to filter non semantic content.
* @return {Array|string} A list of blocks or a string, depending on `handlerMode`.
*/
export function pasteHandler( {
Expand Down Expand Up @@ -154,9 +154,6 @@ export function pasteHandler( {
}

if ( disableFilters ) {
// If the data comes from a rich text instance, we can directly use it
// without filtering the data. The filters are only meant for externally
// pasted content and remove inline styles.
return maybeConvertParagraphToInline( {
blocks: htmlToBlocks( HTML, pasteHandler ),
plainText,
Expand Down

0 comments on commit 09c707c

Please sign in to comment.