The page navigation is complete. You may now navigate the page content as you wish.
Skip to main content

Documentation versions

Other versions
HDS components v7.0.0 is now available! Learn more about the changes in this major release

Custom block extractor playground

Custom component extraction playground

This page is a regression and integration test suite for the Showdown pre-processing pipeline that handles Doc:: and Hds:: component blocks in markdown documentation.

Test 1 - pre inside Doc::Layout (original bug)

TEST pre inside Doc::Layout

Test 2 - div inside Doc::Layout

TEST div inside Doc::Layout

Test 3 - table inside Doc::Layout

TEST table inside Doc::Layout

Test 4 - multiple block children

block one
block two
block three

Test 5 - Hds::Alert with block params (existing working case)

Recommended button usage
Lorem ipsum dolar sit amet.

Test 6 - Hds::Alert with pre inside

Alert with pre
Lorem ipsum.
Lorem ipsum.

Test 7 - nested same-prefix Doc::ComponentApi

<[G].Error> yielded component
Container that yields its content.
<[E].Message> yielded component
Inner nested component API.

Test 8 - pre inside Hds:: (block element inside Hds:: namespace)

Alert with block content below
pre inside Doc::Layout after Alert
div after pre

Test 9 - simple self-closing (regression guard)

self-closing

Test 10 - Doc::Banner with block content (uses contentBlocks extension)

Note

Some content inside a banner.

Test 11 - Mix & Match of HTML and Ember

example code
Alert with pre
Lorem ipsum.
Lorem ipsum.
example code
Alert with pre
Lorem ipsum.
Lorem ipsum.

Test 12 - Self-closing tags

Two consecutive custom self-closing tags (the original trigger for the trailing-newline fix):

A custom self-closing tag immediately followed by a plain HTML self-closing tag:

before br


A custom self-closing tag immediately followed by a markdown list (no blank line in source):

before list

A custom self-closing tag immediately followed by a blockquote:

before blockquote

This is a blockquote after a self-closing component.

A custom self-closing tag at the very end of a section (no trailing content):

last in section

Test 13 - same-line nested Hds:: open+close inside a block

<Hds::Link::Inline>text</Hds::Link::Inline> on a single line inside a block caused the inner depth scanner's CLOSETAGRE (line-start anchored) to miss the close tag, leaving the stack unbalanced and eating the rest of the file.

Form submission error
Correct the formatting of the following fields:

Test 14 - Doc::WcagList self-closing with a Mustache array attribute

A self-closing tag whose attribute contains a Mustache {{array ...}} expression — the real-world pattern from every component's accessibility page.

  • 1.3.1 Info and Relationships (Level A):
    Information, structure, and relationships conveyed through presentation can be programmatically determined or are available in text.
  • 1.3.2 Meaningful Sequence (Level A):
    When the sequence in which content is presented affects its meaning, a correct reading sequence can be programmatically determined.
  • 1.4.1 Use of Color (Level A):
    Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element.
  • 1.4.10 Reflow (Level AA):
    Content can be presented without loss of information or functionality, and without requiring scrolling in two dimensions.
  • 1.4.11 Non-text Contrast (Level AA):
    The visual presentation of the following have a contrast ratio of at least 3:1 against adjacent color(s): user interface components; graphical objects.
  • 1.4.12 Text Spacing (Level AA):
    No loss of content or functionality occurs by setting all of the following and by changing no other style property: line height set to 1.5; spacing following paragraphs set to at least 2x the font size; letter-spacing set at least 0.12x of the font size, word spacing set to at least 0.16 times the font size.
  • 1.4.3 Minimum Contrast (Level AA):
    The visual presentation of text and images of text has a contrast ratio of at least 4.5:1
  • 2.1.1 Keyboard (Level A):
    All functionality of the content is operable through a keyboard interface.
  • 2.1.2 No Keyboard Trap (Level A):
    If keyboard focus can be moved to a component of the page using a keyboard interface, then focus can be moved away from that component using only a keyboard interface.
  • 2.2.1 Timing Adjustable (Level A):
    If there are time limitations set by the content, one of the following should be true: turn off, adjust, extend, real-time exception, essential exception, 20 hour exception.
  • 2.5.3 Label in Name (Level A):
    For user interface components with labels that include text or images of text, the name contains the text that is presented visually.
  • 4.1.2 Name, Role, Value (Level A):
    For all user interface components, the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.
  • 4.1.3 Status Messages (Level AA):
    In content implemented using markup languages, status messages can be programmatically determined through role or properties such that they can be presented to the user by assistive technologies without receiving focus.

Support

If any accessibility issues have been found within this component, let us know by submitting an issue.

Test 15 - Doc:: string inside a Mustache expression (should NOT be extracted)

Text referencing {{component "Hds::Alert"}} inline — the extractor should ignore the quoted string inside the Mustache.

test-15 ok

Test 16 - Doc:: string inside a @name attribute value (should NOT be extracted)

<Hds::Alert> string
The Hds::Alert component name inside an attribute value.

Test 17 - Doc:: inside a markdown inline code span (should NOT be extracted, rendered as literal text)

Use <Doc::Layout> to wrap items. And <Hds::Alert> for alerts.

Test 18 - Doc:: inside a fenced code block (should NOT be extracted)

<Doc::Layout @spacing="12px">
  <pre>example code</pre>
</Doc::Layout>

Test 19 - self-closing with no space before />

no-space-self-close

Test 20 - legitimate paragraph content inside a Doc:: component (Pass 1 must NOT strip it)

someArg string
This property description has a paragraph inside.

Test 21 - Doc:: inside a !!! banner block

Banner containing a component reference

Use

Neutral
inside a banner.

Test 22 - inline Doc::Badge alongside regular text (must stay inline, not extracted as block)

Here is an inline badge

Beta
inside a sentence.

Test 23 - named blocks (Doc::ComponentApi with named block syntax in attribute)

<:head> named block
Named block description.
</:body> named block
Another named block.

Test 24 - Pass 2 must NOT eat a legitimate paragraph before non-custom content

test-24 ok

Some paragraph text after a self-closing component. This paragraph must not be eaten.

Test 25 - backtick code spans inside C.Property descriptions

href
Pass a custom href for the link. (URL parameter that's passed down to the <a> element.)
tag
Renders as a </div> closing tag in the output.
attr
Sets the href="https://example.com" attribute on the element.
attr
Sets the type='button' attribute on the element.
value
Accessed as {{this.value}} in the template.
text
Use &amp; to render a literal ampersand in HTML.
complex1
Example: <input type="text" value='hello' {{onChange}} />.
complex2
Example: <input type="text" value='hello' /> with {{onChange}} handler.
plain-link
See the Ember guides for more information.
code-in-link
This component supports use of ...attributes.
bold-in-link
See important reference for details.
mixed-code-bold-in-link
This component supports use of the ...attributes argument.
italic-in-link
See italic reference for details.
link-mid-sentence
Accepts any icon name, or false for no icon.
multiple-links
See Button and LinkStandalone for related components.
link-with-quotes-in-code
Sets the href="https://example.com" attribute.
mixed-inline-in-link
See the @color argument values for the full list.

Test 27 - Doc:: component inside a markdown blockquote

inside blockquote

Test 28 - Doc:: component inside a markdown list item

Test 29 - Doc:: component inside an HTML table cell

Label
inside table cell

Test 30 - Doc::Badge inline inside a heading

A heading with an inline
Badge
inside it

Test 31 - Doc::Badge inline inside a list item alongside text

Test 32 - Doc::Layout with all children on a single line

block 1
block 2
block 3

Test 33 - C.Property description with bold, backtick, and br mixed

color enum
  • neutral (default)
  • highlight
  • success
Sets the color scheme for background, border, title, and description, which cannot be overridden.

color results in a default icon, which can be overridden.

var foo = "bar"; is bold code, and var foo = "bar"; is italic code.

Test 35 - multi-line self-closing tag with attributes on separate lines

The Doc::TokensList / Doc::IconsList pattern: a self-closing tag whose attributes each appear on their own line, with /> on the final line by itself. processInlineMarkdownInBlock must NOT feed the attribute lines through Showdown.

multi-line self-closing

Test 36 - multi-line opening tag inside an extracted block

A C.Property whose opening tag spans multiple lines (attributes on separate lines, > on the last attribute line). processInlineMarkdownInBlock must keep all attribute lines verbatim — the insideOpenTag flag must engage and disengage correctly without treating @values lines as markdown text runs.

size enum
  • small
  • medium (default)
  • large
Sets the size of the component.
color enum
  • neutral (default)
  • highlight
  • success
  • warning
  • critical
Sets the color scheme. Accepts a markdown link like ...attributes.

Paragraph after the block — must render normally.