Markup diagnostics
When you save your markup, or check it without saving, the parser reports problems it noticed: an image without alt text, a misspelt tag, lines it had to drop. Each one has a line number, a severity, a stable code and, where a one-line change is safe, a suggested replacement for that line. Diagnostics are only shown to you; they are never stored in the build.
Severities
- error: part of the markup was dropped and will not appear on the site.
- warning: the site builds, but something is missing or ignored, such as alt text or a file that doesn't exist.
- hint: probably a mistake, such as a misspelt tag that is now plain text.
Nothing blocks a save or a publish unless you ask for it with --strict.
Blog posts get a smaller set of checks; see Blog posts.
Codes
Every code applies to .page markup except post-not-checked. Posts use only missing-alt, too-many-diagnostics and post-not-checked.
| Code | Severity | Reported when |
|---|---|---|
dropped-block | error | A block doesn't start with a valid header, so everything up to the next line starting with [ is skipped. Typical causes: content before the first page header, a page header missing its closing ] or with text after it, or a line inside /// html that starts with [ (such as a CSS [data-x] { rule). For the last one, indent the line with a space. |
missing-section-marker | error | Content sits right under a page header or [footer] with no /// line before it, or a /// line is indented. The first line is read as a section type and dropped. |
missing-alt | warning | An image has no alt text. See Images, and Blog posts for Markdown. |
unresolved-file | warning | An image, file link, logo: or og_image: points to a file that doesn't exist or couldn't be fetched. |
unknown-key | warning | A line in [site], [site.dark], [blog] or a page's meta: is not a key the block reads. A close match is suggested. |
invalid-lang | warning | A lang: value is not a language code such as en or pt-BR. |
invalid-translation | warning | A translation: line is not written as translation: ro -> /ro/page. |
invalid-meta | warning | A page's meta: block could not be read and was ignored. |
translation-unresolved | warning | A translation: points to no page. |
translation-noindex | warning | A translation involves a noindex page and was ignored. |
translation-conflict | warning | A page is declared as two languages, or a translation: disagrees with that page's own lang:. |
translation-duplicate-lang | warning | Two pages in one translation group use the same language. |
unknown-tag | hint | A line starts with something close to a tag, such as buton:, so it is plain text. The real tag is suggested. |
arrow-in-text | hint | A text line contains <-, so it was read as an image. Start it with p: to keep it as text. |
too-many-diagnostics | hint | More than 50 problems were found. The 50 most severe are shown, errors first. In a post, the first 50 by line are shown. |
post-not-checked | hint | Posts only. The post body is over 1 MB, so it was not checked for missing alt text. It has no line number. |
New codes may be added.
Blog posts
Saving a post checks its Markdown body for images without alt text and reports each as a missing-alt warning, with a line and column:
, and a reference image such as![][team], with empty or blank alt text.- An HTML
<img>with noaltattribute, or with an alt of only spaces.
<img src="divider.png" alt=""> (or a bare alt) marks a decorative image and doesn't warn. Markdown's ![]() can't say an image is decorative, so use the HTML form for that. Images inside code blocks, inline code, HTML comments, and <script>, <style>, <textarea> or <pre> are ignored, and so is Markdown image syntax inside an HTML block such as <div>, where it isn't rendered as an image.
Post warnings never block a save: the post is saved first, and there is no --strict for posts. Post diagnostics have no suggested fix.
Where you see them
- CLI:
micropage checkreports them for your local.pagefiles without saving a build, andmicropage fixapplies the suggested fixes. See Check & fix.micropage push,micropage publish,micropage projects publishandmicropage projects deployprint them for.pagefiles. See Builds & publish.micropage posts pushprints them for each post it saves. See Posts. - MCP server:
check_pagereturns them without saving.save_pageandupsert_postreturn them in adiagnosticsfield. See Tools. - Web editor: checks a page about 1.5 seconds after you stop typing, and again when you save, and marks each problem on its line. See Editor. The post editor doesn't show them yet.
What check doesn't verify
micropage check, check_page and the web editor's check never save, upload or download anything, so they can miss problems that a save reports:
- An image URL or an Unsplash keyword that isn't already stored in the project is not fetched. A broken URL is only reported when you push or save.
micropage checkassumes every file inassets/will be uploaded by the next push, so it doesn't report a reference to one of them as missing.
The check does apply the save's limit of 50 new images per build. Over it, the check fails with the same message a push would give.