You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Michael Rawlings edited this page Feb 8, 2017
·
11 revisions
Not expecting a tag? If you're writing text at the root of a template, remember, Marko starts in concise mode and any text not prefixed with -- will be parsed as a tag declaration.
When Marko encounters an unrecognized tag at compile-time it will throw an error by default. For example:
This allows Marko to catch potential problems as early as possible, but it does require that Marko be aware of all of the possible tag names (including tag names for standard HTML elements, Marko UI components and custom HTML elements).
If you are wanting to use an HTML custom element in your Marko template and you want the element to passthrough then you will need to register the custom element. Simply create a html-elements.json in the same directory or a higher up directory and register the tag as shown below.
src/components/hello/index.marko:
<my-custom-elementname="Frank" />
src/html-elements.json:
{
"<my-custom-element>": {}
}
With that change in place, the Marko compiler will not complain that the <my-custom-element> tag is unrecognized.