Skip to content

Update block-templates error message and docs#46

Open
carolinan wants to merge 1 commit intoWordPress:trunkfrom
carolinan:update/block-templates
Open

Update block-templates error message and docs#46
carolinan wants to merge 1 commit intoWordPress:trunkfrom
carolinan:update/block-templates

Conversation

@carolinan
Copy link
Contributor

@carolinan carolinan commented Jul 4, 2021

Updates the error message and docs for the test that checks if block templates are complete.

Current:
There's a problem with templates in: filename

After:
There's a problem with the markup in filename. There are unclosed tags or multiline blocks that are missing closing tags. Blocks are self-containing; the opening tag and the closing tag must be in the same template.

) {
failures.push(
`There's a problem with templates in: ${ templates[ i ].fileName }.`
`There's a problem with the markup in ${templates[i].fileName }. There are unclosed tags or multiline blocks that are missing closing tags. Blocks are self-containing; the opening tag and the closing tag must be in the same template.`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't think the extra sentences are required here, but clarification on the wording of the error makes sense.

Having an error message that is not explicit of the error seems unhelpful to me - that's what the documentation is for.

Thoughts @carolinan

Suggested change
`There's a problem with the markup in ${templates[i].fileName }. There are unclosed tags or multiline blocks that are missing closing tags. Blocks are self-containing; the opening tag and the closing tag must be in the same template.`
`There's a problem with the markup in ${templates[i].fileName }.`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The markup in (name) is invalid" might be better?

) {
failures.push(
`There's a problem with templates in: ${ templates[ i ].fileName }.`
`There's a problem with the markup in ${templates[i].fileName }. There are unclosed tags or multiline blocks that are missing closing tags. Blocks are self-containing; the opening tag and the closing tag must be in the same template.`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`There's a problem with the markup in ${templates[i].fileName }. There are unclosed tags or multiline blocks that are missing closing tags. Blocks are self-containing; the opening tag and the closing tag must be in the same template.`
`The markup in ${templates[i].fileName } is invalid.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants