Arnica Markdown Extension for Structural Elements

August 28, 2025 by Igor Lozhkin
Arnica NanoConverter includes service which converts Markdown to HTML. In addition to the core Markdown syntax, Arnica variant also supports most of Github Flavored Markdown (GFM) extensions. 

However, none of the variants (native or GFM) do natively support HTML structural elements SPAN and DIV. Developers usually resort to the imbedded HTML when such support is needed. 

Arnica variant extends core Markdown with support for SPAN and DIV using @! and !@ notations.

Below are most frequently used cases.

DIV with classes:

<div class="red">content</div> 

@!red!
content
!@

DIV without classes:

<div>content</div> 

@!!
content
!@

SPAN with classes:

<span class="red">content</span> 

@!red!content!@

SPAN without classes:

<span>content</span> 

@!!content!@


In Arnica implementation, the nested structural elements are allowed. The difference between DIV and SPAN implementation in Markdown is multi-line vs single-line placement of markdown tags.

Auto-closing of DIV and SPAN elements is supported when the closing !@ tag is missing. 

For example the following is a valid DIV case:

@!red!
content

And the following are valid SPAN cases:

@!!content
@!!content
@!red!content

However, the following expressions are invalid (missing class delimiter):

Invalid DIV:

@!
content
!@

Invalid SPAN:

@!content