Skip to content

Instantly share code, notes, and snippets.

@aduth
Last active April 18, 2017 20:10
Show Gist options
  • Save aduth/6f039e7da2a312a1689c4ace2a2d062c to your computer and use it in GitHub Desktop.
Save aduth/6f039e7da2a312a1689c4ace2a2d062c to your computer and use it in GitHub Desktop.

Quote:

<Element name="blockquote">
	<OneOrMore>
		<Element name="p">
			<Text as="value" />
		</Element>
	</OneOrMore>
	<Optional>
		<Element name="footer">
			<Text as="citation" />
		</Element>
	</Optional>
</Element>
{
	value: [
		'foo',
		'bar'
	],
	citation: 'andrew'
}

Heading:

<Element>
	<Choice as="tagName" required>
		<Name>h1</Name>
		<Name>h2</Name>
		<Name>h3</Name>
		<Name>h4</Name>
	</Choice>
	<Attribute name="style">
		<Match
			pattern="\btext-align:\s*([^;]+)"
			index="1"
			as="align"
			default="left" />
	</Attribute>
	<Text as="content" />
</Element>
{
	tagName: 'h1',
	align: 'left',
	content: '1.0 is the loneliest number'
}

Image:

<Element name="figure">
	<Element name="img">
		<Attribute name="src" as="url" required />
		<Attribute name="alt" as="alt" />
	</Element>
	<Optional>
		<Element name="figcaption">
			<Text as="caption" />
		</Element>
	</Optional>
</Element>
{
	url: 'https://lorempixel.com/200/500'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment