Skip to content

Commit

Permalink
Add documentation for undefined attribute source (fixes #5545). (#6365)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ned Zimmerman authored and youknowriad committed Apr 24, 2018
1 parent e05a542 commit 2f44415
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/block-api/attributes.md
Expand Up @@ -4,6 +4,8 @@

Attribute sources are used to define the strategy by which block attribute values are extracted from saved post content. They provide a mechanism to map from the saved markup to a JavaScript representation of a block.

If no attribute source is specified, the attribute will be saved to (and read from) the block's [comment delimiter](../language.md).

Each source accepts an optional selector as the first argument. If a selector is specified, the source behavior will be run against the corresponding element(s) contained within the block. Otherwise it will be run against the block's root node.

Under the hood, attribute sources are a superset of functionality provided by [hpq](https://github.com/aduth/hpq), a small library used to parse and query HTML markup into an object shape. In an object of attributes sources, you can name the keys as you see fit. The resulting object will assign as a value to each key the result of its attribute source.
Expand Down

0 comments on commit 2f44415

Please sign in to comment.