Skip to content

Commit

Permalink
HTML block: fix parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 25, 2020
1 parent e3476a6 commit 19ee60a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/html/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"attributes": {
"content": {
"type": "string",
"source": "html"
"source": "raw"
}
},
"supports": {
Expand Down
7 changes: 6 additions & 1 deletion packages/blocks/src/api/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,17 @@ export function getBlockAttribute(
let value;

switch ( attributeSchema.source ) {
// undefined source means that it's an attribute serialized to the block's "comment"
// undefined source means that it's an attribute serialized to the
// block's "comment"
case undefined:
value = commentAttributes
? commentAttributes[ attributeKey ]
: undefined;
break;
// raw source means that it's the original raw block content.
case 'raw':
value = innerHTML;
break;
case 'attribute':
case 'property':
case 'html':
Expand Down

0 comments on commit 19ee60a

Please sign in to comment.